@@ -41,7 +41,7 @@ |
||
| 41 | 41 | public function setDate($date) { |
| 42 | 42 | $this->date = $date; |
| 43 | 43 | if ($this->getDay()) { |
| 44 | - $this->dateFormatted = $this->getYear() .'-'. $this->getMonth() .'-'. substr("0{$this->getDay()}", -2); |
|
| 44 | + $this->dateFormatted = $this->getYear().'-'.$this->getMonth().'-'.substr("0{$this->getDay()}", -2); |
|
| 45 | 45 | } |
| 46 | 46 | else { |
| 47 | 47 | $this->month = $this->getMonth(); |
@@ -42,8 +42,7 @@ |
||
| 42 | 42 | $this->date = $date; |
| 43 | 43 | if ($this->getDay()) { |
| 44 | 44 | $this->dateFormatted = $this->getYear() .'-'. $this->getMonth() .'-'. substr("0{$this->getDay()}", -2); |
| 45 | - } |
|
| 46 | - else { |
|
| 45 | + } else { |
|
| 47 | 46 | $this->month = $this->getMonth(); |
| 48 | 47 | $this->year = $this->getYear(); |
| 49 | 48 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | |
| 35 | 35 | public function setDate($date) { |
| 36 | 36 | $this->date = $date; |
| 37 | - $this->dateFormatted = $this->getYear() .'-'. $this->getMonth() .'-'. substr("0{$this->getDay()}", -2); |
|
| 37 | + $this->dateFormatted = $this->getYear().'-'.$this->getMonth().'-'.substr("0{$this->getDay()}", -2); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function getDateFormatted() { |
@@ -50,150 +50,150 @@ |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | switch ($recordType) { |
| 53 | - case '_UID': |
|
| 54 | - $indi->setUid(trim($record[2])); |
|
| 55 | - break; |
|
| 56 | - case 'RESN': |
|
| 57 | - $indi->setResn(trim($record[2])); |
|
| 58 | - break; |
|
| 59 | - case 'NAME': |
|
| 60 | - $name = \Gedcom\Parser\Indi\Name::parse($parser); |
|
| 61 | - $indi->addName($name); |
|
| 62 | - break; |
|
| 63 | - case 'SEX': |
|
| 64 | - $indi->setSex(isset($record[2]) ? trim($record[2]) : ''); |
|
| 65 | - break; |
|
| 66 | - case 'ADOP': |
|
| 67 | - case 'BIRT': |
|
| 68 | - $birt = \Gedcom\Parser\Birt::parse($parser); |
|
| 69 | - $indi->setBirt($birt); |
|
| 70 | - break; |
|
| 71 | - case 'BAPM': |
|
| 72 | - case 'BARM': |
|
| 73 | - case 'BASM': |
|
| 74 | - case 'BLES': |
|
| 75 | - case 'BURI': |
|
| 76 | - $buri = \Gedcom\Parser\Buri::parse($parser); |
|
| 77 | - $indi->setBuri($buri); |
|
| 78 | - break; |
|
| 79 | - case 'CENS': |
|
| 80 | - case 'CHR': |
|
| 81 | - $chr = \Gedcom\Parser\Chr::parse($parser); |
|
| 82 | - $indi->setChr($chr); |
|
| 83 | - break; |
|
| 84 | - case 'CHRA': |
|
| 85 | - case 'CONF': |
|
| 86 | - case 'CREM': |
|
| 87 | - case 'DEAT': |
|
| 88 | - $deat = \Gedcom\Parser\Deat::parse($parser); |
|
| 89 | - $indi->setDeat($deat); |
|
| 90 | - break; |
|
| 91 | - case 'EMIG': |
|
| 92 | - case 'FCOM': |
|
| 93 | - case 'GRAD': |
|
| 94 | - case 'IMMI': |
|
| 95 | - case 'NATU': |
|
| 96 | - case 'ORDN': |
|
| 97 | - case 'RETI': |
|
| 98 | - case 'PROB': |
|
| 99 | - case 'WILL': |
|
| 100 | - case 'EVEN': |
|
| 101 | - $className = ucfirst(strtolower($recordType)); |
|
| 102 | - $class = '\\Gedcom\\Parser\\Indi\\'.$className; |
|
| 53 | + case '_UID': |
|
| 54 | + $indi->setUid(trim($record[2])); |
|
| 55 | + break; |
|
| 56 | + case 'RESN': |
|
| 57 | + $indi->setResn(trim($record[2])); |
|
| 58 | + break; |
|
| 59 | + case 'NAME': |
|
| 60 | + $name = \Gedcom\Parser\Indi\Name::parse($parser); |
|
| 61 | + $indi->addName($name); |
|
| 62 | + break; |
|
| 63 | + case 'SEX': |
|
| 64 | + $indi->setSex(isset($record[2]) ? trim($record[2]) : ''); |
|
| 65 | + break; |
|
| 66 | + case 'ADOP': |
|
| 67 | + case 'BIRT': |
|
| 68 | + $birt = \Gedcom\Parser\Birt::parse($parser); |
|
| 69 | + $indi->setBirt($birt); |
|
| 70 | + break; |
|
| 71 | + case 'BAPM': |
|
| 72 | + case 'BARM': |
|
| 73 | + case 'BASM': |
|
| 74 | + case 'BLES': |
|
| 75 | + case 'BURI': |
|
| 76 | + $buri = \Gedcom\Parser\Buri::parse($parser); |
|
| 77 | + $indi->setBuri($buri); |
|
| 78 | + break; |
|
| 79 | + case 'CENS': |
|
| 80 | + case 'CHR': |
|
| 81 | + $chr = \Gedcom\Parser\Chr::parse($parser); |
|
| 82 | + $indi->setChr($chr); |
|
| 83 | + break; |
|
| 84 | + case 'CHRA': |
|
| 85 | + case 'CONF': |
|
| 86 | + case 'CREM': |
|
| 87 | + case 'DEAT': |
|
| 88 | + $deat = \Gedcom\Parser\Deat::parse($parser); |
|
| 89 | + $indi->setDeat($deat); |
|
| 90 | + break; |
|
| 91 | + case 'EMIG': |
|
| 92 | + case 'FCOM': |
|
| 93 | + case 'GRAD': |
|
| 94 | + case 'IMMI': |
|
| 95 | + case 'NATU': |
|
| 96 | + case 'ORDN': |
|
| 97 | + case 'RETI': |
|
| 98 | + case 'PROB': |
|
| 99 | + case 'WILL': |
|
| 100 | + case 'EVEN': |
|
| 101 | + $className = ucfirst(strtolower($recordType)); |
|
| 102 | + $class = '\\Gedcom\\Parser\\Indi\\'.$className; |
|
| 103 | 103 | |
| 104 | - $event = $class::parse($parser); |
|
| 105 | - $indi->addEven($event); |
|
| 106 | - break; |
|
| 107 | - case 'CAST': |
|
| 108 | - case 'DSCR': |
|
| 109 | - case 'EDUC': |
|
| 110 | - case 'IDNO': |
|
| 111 | - case 'NATI': |
|
| 112 | - case 'NCHI': |
|
| 113 | - case 'NMR': |
|
| 114 | - case 'OCCU': |
|
| 115 | - case 'PROP': |
|
| 116 | - case 'RELI': |
|
| 117 | - case 'RESI': |
|
| 118 | - case 'SSN': |
|
| 119 | - case 'TITL': |
|
| 120 | - $className = ucfirst(strtolower($recordType)); |
|
| 121 | - $class = '\\Gedcom\\Parser\\Indi\\'.$className; |
|
| 104 | + $event = $class::parse($parser); |
|
| 105 | + $indi->addEven($event); |
|
| 106 | + break; |
|
| 107 | + case 'CAST': |
|
| 108 | + case 'DSCR': |
|
| 109 | + case 'EDUC': |
|
| 110 | + case 'IDNO': |
|
| 111 | + case 'NATI': |
|
| 112 | + case 'NCHI': |
|
| 113 | + case 'NMR': |
|
| 114 | + case 'OCCU': |
|
| 115 | + case 'PROP': |
|
| 116 | + case 'RELI': |
|
| 117 | + case 'RESI': |
|
| 118 | + case 'SSN': |
|
| 119 | + case 'TITL': |
|
| 120 | + $className = ucfirst(strtolower($recordType)); |
|
| 121 | + $class = '\\Gedcom\\Parser\\Indi\\'.$className; |
|
| 122 | 122 | |
| 123 | - $att = $class::parse($parser); |
|
| 124 | - $indi->addAttr($att); |
|
| 125 | - break; |
|
| 126 | - case 'BAPL': |
|
| 127 | - case 'CONL': |
|
| 128 | - case 'ENDL': |
|
| 129 | - case 'SLGC': |
|
| 130 | - $className = ucfirst(strtolower($recordType)); |
|
| 131 | - $class = '\\Gedcom\\Parser\\Indi\\'.$className; |
|
| 123 | + $att = $class::parse($parser); |
|
| 124 | + $indi->addAttr($att); |
|
| 125 | + break; |
|
| 126 | + case 'BAPL': |
|
| 127 | + case 'CONL': |
|
| 128 | + case 'ENDL': |
|
| 129 | + case 'SLGC': |
|
| 130 | + $className = ucfirst(strtolower($recordType)); |
|
| 131 | + $class = '\\Gedcom\\Parser\\Indi\\'.$className; |
|
| 132 | 132 | |
| 133 | - $lds = $class::parse($parser); |
|
| 134 | - $indi->{'add'.$recordType}[] = $lds; |
|
| 135 | - break; |
|
| 136 | - case 'FAMC': |
|
| 137 | - $famc = \Gedcom\Parser\Indi\Famc::parse($parser); |
|
| 138 | - if ($famc) { |
|
| 139 | - $indi->addFamc($famc); |
|
| 140 | - } |
|
| 141 | - break; |
|
| 142 | - case 'FAMS': |
|
| 143 | - $fams = \Gedcom\Parser\Indi\Fams::parse($parser); |
|
| 144 | - if ($fams) { |
|
| 145 | - $indi->addFams($fams); |
|
| 146 | - } |
|
| 147 | - break; |
|
| 148 | - case 'SUBM': |
|
| 149 | - $indi->addSubm($parser->normalizeIdentifier($record[2])); |
|
| 150 | - break; |
|
| 151 | - case 'ASSO': |
|
| 152 | - $asso = \Gedcom\Parser\Indi\Asso::parse($parser); |
|
| 153 | - $indi->addAsso($asso); |
|
| 154 | - break; |
|
| 155 | - case 'ALIA': |
|
| 156 | - $indi->addAlia($parser->normalizeIdentifier($record[2])); |
|
| 157 | - break; |
|
| 158 | - case 'ANCI': |
|
| 159 | - $indi->addAnci($parser->normalizeIdentifier($record[2])); |
|
| 160 | - break; |
|
| 161 | - case 'DESI': |
|
| 162 | - $indi->addDesi($parser->normalizeIdentifier($record[2])); |
|
| 163 | - break; |
|
| 164 | - case 'RFN': |
|
| 165 | - $indi->setRfn(trim($record[2])); |
|
| 166 | - break; |
|
| 167 | - case 'AFN': |
|
| 168 | - $indi->setAfn(trim($record[2])); |
|
| 169 | - break; |
|
| 170 | - case 'REFN': |
|
| 171 | - $ref = \Gedcom\Parser\Refn::parse($parser); |
|
| 172 | - $indi->addRefn($ref); |
|
| 173 | - break; |
|
| 174 | - case 'RIN': |
|
| 175 | - $indi->setRin(trim($record[2])); |
|
| 176 | - break; |
|
| 177 | - case 'CHAN': |
|
| 178 | - $chan = \Gedcom\Parser\Chan::parse($parser); |
|
| 179 | - $indi->setChan($chan); |
|
| 180 | - break; |
|
| 181 | - case 'NOTE': |
|
| 182 | - $note = \Gedcom\Parser\NoteRef::parse($parser); |
|
| 183 | - if ($note) { |
|
| 184 | - $indi->addNote($note); |
|
| 185 | - } |
|
| 186 | - break; |
|
| 187 | - case 'SOUR': |
|
| 188 | - $sour = \Gedcom\Parser\SourRef::parse($parser); |
|
| 189 | - $indi->addSour($sour); |
|
| 190 | - break; |
|
| 191 | - case 'OBJE': |
|
| 192 | - $obje = \Gedcom\Parser\ObjeRef::parse($parser); |
|
| 193 | - $indi->addObje($obje); |
|
| 194 | - break; |
|
| 195 | - default: |
|
| 196 | - $parser->logUnhandledRecord(self::class.' @ '.__LINE__); |
|
| 133 | + $lds = $class::parse($parser); |
|
| 134 | + $indi->{'add'.$recordType}[] = $lds; |
|
| 135 | + break; |
|
| 136 | + case 'FAMC': |
|
| 137 | + $famc = \Gedcom\Parser\Indi\Famc::parse($parser); |
|
| 138 | + if ($famc) { |
|
| 139 | + $indi->addFamc($famc); |
|
| 140 | + } |
|
| 141 | + break; |
|
| 142 | + case 'FAMS': |
|
| 143 | + $fams = \Gedcom\Parser\Indi\Fams::parse($parser); |
|
| 144 | + if ($fams) { |
|
| 145 | + $indi->addFams($fams); |
|
| 146 | + } |
|
| 147 | + break; |
|
| 148 | + case 'SUBM': |
|
| 149 | + $indi->addSubm($parser->normalizeIdentifier($record[2])); |
|
| 150 | + break; |
|
| 151 | + case 'ASSO': |
|
| 152 | + $asso = \Gedcom\Parser\Indi\Asso::parse($parser); |
|
| 153 | + $indi->addAsso($asso); |
|
| 154 | + break; |
|
| 155 | + case 'ALIA': |
|
| 156 | + $indi->addAlia($parser->normalizeIdentifier($record[2])); |
|
| 157 | + break; |
|
| 158 | + case 'ANCI': |
|
| 159 | + $indi->addAnci($parser->normalizeIdentifier($record[2])); |
|
| 160 | + break; |
|
| 161 | + case 'DESI': |
|
| 162 | + $indi->addDesi($parser->normalizeIdentifier($record[2])); |
|
| 163 | + break; |
|
| 164 | + case 'RFN': |
|
| 165 | + $indi->setRfn(trim($record[2])); |
|
| 166 | + break; |
|
| 167 | + case 'AFN': |
|
| 168 | + $indi->setAfn(trim($record[2])); |
|
| 169 | + break; |
|
| 170 | + case 'REFN': |
|
| 171 | + $ref = \Gedcom\Parser\Refn::parse($parser); |
|
| 172 | + $indi->addRefn($ref); |
|
| 173 | + break; |
|
| 174 | + case 'RIN': |
|
| 175 | + $indi->setRin(trim($record[2])); |
|
| 176 | + break; |
|
| 177 | + case 'CHAN': |
|
| 178 | + $chan = \Gedcom\Parser\Chan::parse($parser); |
|
| 179 | + $indi->setChan($chan); |
|
| 180 | + break; |
|
| 181 | + case 'NOTE': |
|
| 182 | + $note = \Gedcom\Parser\NoteRef::parse($parser); |
|
| 183 | + if ($note) { |
|
| 184 | + $indi->addNote($note); |
|
| 185 | + } |
|
| 186 | + break; |
|
| 187 | + case 'SOUR': |
|
| 188 | + $sour = \Gedcom\Parser\SourRef::parse($parser); |
|
| 189 | + $indi->addSour($sour); |
|
| 190 | + break; |
|
| 191 | + case 'OBJE': |
|
| 192 | + $obje = \Gedcom\Parser\ObjeRef::parse($parser); |
|
| 193 | + $indi->addObje($obje); |
|
| 194 | + break; |
|
| 195 | + default: |
|
| 196 | + $parser->logUnhandledRecord(self::class.' @ '.__LINE__); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | $parser->forward(); |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | public function setDate($date) { |
| 42 | 42 | $this->date = $date; |
| 43 | 43 | if ($this->getDay()) { |
| 44 | - $this->dateFormatted = $this->getYear() .'-'. $this->getMonth() .'-'. substr("0{$this->getDay()}", -2); |
|
| 44 | + $this->dateFormatted = $this->getYear().'-'.$this->getMonth().'-'.substr("0{$this->getDay()}", -2); |
|
| 45 | 45 | } |
| 46 | 46 | else { |
| 47 | 47 | $this->month = $this->getMonth(); |
@@ -42,8 +42,7 @@ |
||
| 42 | 42 | $this->date = $date; |
| 43 | 43 | if ($this->getDay()) { |
| 44 | 44 | $this->dateFormatted = $this->getYear() .'-'. $this->getMonth() .'-'. substr("0{$this->getDay()}", -2); |
| 45 | - } |
|
| 46 | - else { |
|
| 45 | + } else { |
|
| 47 | 46 | $this->month = $this->getMonth(); |
| 48 | 47 | $this->year = $this->getYear(); |
| 49 | 48 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | public function setDate($date) { |
| 42 | 42 | $this->date = $date; |
| 43 | 43 | if ($this->getDay()) { |
| 44 | - $this->dateFormatted = $this->getYear() .'-'. $this->getMonth() .'-'. substr("0{$this->getDay()}", -2); |
|
| 44 | + $this->dateFormatted = $this->getYear().'-'.$this->getMonth().'-'.substr("0{$this->getDay()}", -2); |
|
| 45 | 45 | } |
| 46 | 46 | else { |
| 47 | 47 | $this->month = $this->getMonth(); |
@@ -42,8 +42,7 @@ |
||
| 42 | 42 | $this->date = $date; |
| 43 | 43 | if ($this->getDay()) { |
| 44 | 44 | $this->dateFormatted = $this->getYear() .'-'. $this->getMonth() .'-'. substr("0{$this->getDay()}", -2); |
| 45 | - } |
|
| 46 | - else { |
|
| 45 | + } else { |
|
| 47 | 46 | $this->month = $this->getMonth(); |
| 48 | 47 | $this->year = $this->getYear(); |
| 49 | 48 | } |