Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 908b4b1

Browse files
author
kristopherwilson
committed
add reference getter and setters for HEAD and sub records
1 parent 7142cc2 commit 908b4b1

File tree

3 files changed

+201
-6
lines changed

3 files changed

+201
-6
lines changed

lib/Gedcom/Parser/Head.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,23 @@ public static function &parse(\Gedcom\Parser &$parser)
8787
break;
8888

8989
case 'DATE':
90-
$head->setDate(\Gedcom\Parser\Head\Date::parse($parser));
90+
$date = \Gedcom\Parser\Head\Date::parse($parser);
91+
$head->setDate($date);
9192
break;
9293

9394
case 'GEDC':
94-
$head->setGedc(\Gedcom\Parser\Head\Gedc::parse($parser));
95+
$gedc = \Gedcom\Parser\Head\Gedc::parse($parser);
96+
$head->setGedc($gedc);
9597
break;
9698

9799
case 'CHAR':
98-
$head->setChar(\Gedcom\Parser\Head\Char::parse($parser));
100+
$char = \Gedcom\Parser\Head\Char::parse($parser);
101+
$head->setChar($char);
99102
break;
100103

101104
case 'PLAC':
102-
$head->setPlac(\Gedcom\Parser\Head\Plac::parse($parser));
105+
$plac = \Gedcom\Parser\Head\Plac::parse($parser);
106+
$head->setPlac($plac);
103107
break;
104108

105109
case 'NOTE':

lib/Gedcom/Record/Head.php

Lines changed: 138 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,157 @@
1616
namespace Gedcom\Record;
1717

1818
/**
19-
*
19+
* Stores the data from the HEAD section of a GEDCOM 5.5 file.
2020
*/
2121
class Head extends \Gedcom\Record
2222
{
23+
/**
24+
*
25+
*/
2326
protected $_sour = null;
27+
28+
/**
29+
*
30+
*/
2431
protected $_dest = null;
32+
33+
/**
34+
*
35+
*/
2536
protected $_date = null;
37+
38+
/**
39+
*
40+
*/
2641
protected $_subm = null;
42+
43+
/**
44+
*
45+
*/
2746
protected $_subn = null;
47+
48+
/**
49+
*
50+
*/
2851
protected $_file = null;
52+
53+
/**
54+
*
55+
*/
2956
protected $_copr = null;
57+
58+
/**
59+
*
60+
*/
3061
protected $_gedc = null;
62+
63+
/**
64+
*
65+
*/
3166
protected $_char = null;
67+
68+
/**
69+
*
70+
*/
3271
protected $_lang = null;
72+
73+
/**
74+
*
75+
*/
3376
protected $_plac = null;
77+
78+
/**
79+
*
80+
*/
3481
protected $_note = null;
82+
83+
/**
84+
*
85+
* @param \Gedcom\Record\Head\Sour $sour
86+
*/
87+
public function setSour(\Gedcom\Record\Head\Sour &$sour)
88+
{
89+
$this->_sour = &$sour;
90+
}
91+
92+
/**
93+
*
94+
* @return \Gedcom\Record\Head\Sour
95+
*/
96+
public function &getSour()
97+
{
98+
return $this->_sour;
99+
}
100+
101+
/**
102+
*
103+
* @param \Gedcom\Record\Head\Date $date
104+
*/
105+
public function setDate(\Gedcom\Record\Head\Date &$date)
106+
{
107+
$this->_date = &$date;
108+
}
109+
110+
/**
111+
*
112+
* @return \Gedcom\Record\Head\Date
113+
*/
114+
public function &getDate()
115+
{
116+
return $this->_date;
117+
}
118+
119+
/**
120+
*
121+
* @param \Gedcom\Record\Head\Gedc $gedc
122+
*/
123+
public function setGedc(\Gedcom\Record\Head\Gedc &$gedc)
124+
{
125+
$this->_gedc = &$gedc;
126+
}
127+
128+
/**
129+
*
130+
* @return \Gedcom\Record\Head\Gedc
131+
*/
132+
public function &getGedc()
133+
{
134+
return $this->_gedc;
135+
}
136+
137+
/**
138+
*
139+
* @param \Gedcom\Record\Head\Char $char
140+
*/
141+
public function setChar(\Gedcom\Record\Head\Char &$char)
142+
{
143+
$this->_char = &$char;
144+
}
145+
146+
/**
147+
*
148+
* @return \Gedcom\Record\Head\Char
149+
*/
150+
public function &getChar()
151+
{
152+
return $this->_char;
153+
}
154+
155+
/**
156+
*
157+
* @param \Gedcom\Record\Head\Plac $plac
158+
*/
159+
public function setPlac(\Gedcom\Record\Head\Plac &$plac)
160+
{
161+
$this->_plac = &$plac;
162+
}
163+
164+
/**
165+
*
166+
* @return \Gedcom\Record\Head\Plac
167+
*/
168+
public function &getPlac()
169+
{
170+
return $this->_plac;
171+
}
35172
}
36-

lib/Gedcom/Record/Head/Sour.php

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,64 @@
2020
*/
2121
class Sour extends \Gedcom\Record
2222
{
23+
/**
24+
*
25+
*/
2326
protected $_sour = null;
27+
28+
/**
29+
*
30+
*/
2431
protected $_vers = null;
32+
33+
/**
34+
*
35+
*/
2536
protected $_name = null;
37+
38+
/**
39+
*
40+
*/
2641
protected $_corp = null;
42+
43+
/**
44+
*
45+
*/
2746
protected $_data = null;
47+
48+
/**
49+
*
50+
* @param \Gedcom\Record\Head\Sour\Corp $sour
51+
*/
52+
public function setCorp(\Gedcom\Record\Head\Sour\Corp &$corp)
53+
{
54+
$this->_corp = &$corp;
55+
}
56+
57+
/**
58+
*
59+
* @return \Gedcom\Record\Head\Sour\Corp
60+
*/
61+
public function &getCorp()
62+
{
63+
return $this->_corp;
64+
}
65+
66+
/**
67+
*
68+
* @param \Gedcom\Record\Head\Sour\Data $data
69+
*/
70+
public function setData(\Gedcom\Record\Head\Sour\Data &$data)
71+
{
72+
$this->_data = &$data;
73+
}
74+
75+
/**
76+
*
77+
* @return \Gedcom\Record\Head\Sour\Data
78+
*/
79+
public function &getData()
80+
{
81+
return $this->_data;
82+
}
2883
}

0 commit comments

Comments
 (0)