├── .github └── FUNDING.yml ├── .gitignore ├── .travis.yml ├── CONTRIBUTE.md ├── LICENSE.md ├── README.md ├── composer.json ├── composer.lock ├── rector.php ├── src ├── Gedcom.php ├── Parser.php ├── Parser │ ├── Addr.php │ ├── Birt.php │ ├── Buri.php │ ├── Caln.php │ ├── Chan.php │ ├── Chr.php │ ├── Component.php │ ├── Date.php │ ├── Deat.php │ ├── Fam.php │ ├── Fam │ │ ├── Anul.php │ │ ├── Cens.php │ │ ├── Div.php │ │ ├── Divf.php │ │ ├── Enga.php │ │ ├── Even.php │ │ ├── Even │ │ │ ├── Husb.php │ │ │ └── Wife.php │ │ ├── Marb.php │ │ ├── Marc.php │ │ ├── Marl.php │ │ ├── Marr.php │ │ ├── Mars.php │ │ ├── Slgs.php │ │ └── Slgs │ │ │ └── Stat.php │ ├── Head.php │ ├── Head │ │ ├── Char.php │ │ ├── Date.php │ │ ├── Gedc.php │ │ ├── Plac.php │ │ ├── Sour.php │ │ └── Sour │ │ │ ├── Corp.php │ │ │ └── Data.php │ ├── Indi.php │ ├── Indi │ │ ├── Adop.php │ │ ├── Asso.php │ │ ├── Attr.php │ │ ├── Bapl.php │ │ ├── Bapm.php │ │ ├── Barm.php │ │ ├── Basm.php │ │ ├── Birt.php │ │ ├── Bles.php │ │ ├── Buri.php │ │ ├── Cast.php │ │ ├── Cens.php │ │ ├── Chr.php │ │ ├── Chra.php │ │ ├── Conf.php │ │ ├── Conl.php │ │ ├── Crem.php │ │ ├── Deat.php │ │ ├── Dscr.php │ │ ├── Educ.php │ │ ├── Emig.php │ │ ├── Endl.php │ │ ├── Even.php │ │ ├── Even │ │ │ └── Plac.php │ │ ├── Famc.php │ │ ├── Fams.php │ │ ├── Fcom.php │ │ ├── Grad.php │ │ ├── Idno.php │ │ ├── Immi.php │ │ ├── Lds.php │ │ ├── Name.php │ │ ├── Name │ │ │ ├── Fone.php │ │ │ └── Romn.php │ │ ├── Nati.php │ │ ├── Natu.php │ │ ├── Nchi.php │ │ ├── Nmr.php │ │ ├── Occu.php │ │ ├── Ordn.php │ │ ├── Prob.php │ │ ├── Prop.php │ │ ├── Reli.php │ │ ├── Resi.php │ │ ├── Reti.php │ │ ├── Slgc.php │ │ ├── Ssn.php │ │ ├── Titl.php │ │ └── Will.php │ ├── Note.php │ ├── NoteRef.php │ ├── Obje.php │ ├── ObjeRef.php │ ├── ObjeRef │ │ ├── File.php │ │ └── File │ │ │ └── Form.php │ ├── Phon.php │ ├── Plac.php │ ├── Plac │ │ ├── Fone.php │ │ ├── Map.php │ │ └── Romn.php │ ├── Refn.php │ ├── Repo.php │ ├── RepoRef.php │ ├── Sour.php │ ├── Sour │ │ ├── Data.php │ │ ├── Data │ │ │ └── Even.php │ │ ├── Repo.php │ │ └── Repo │ │ │ └── Caln.php │ ├── SourRef.php │ ├── SourRef │ │ ├── Data.php │ │ └── Even.php │ ├── Subm.php │ └── Subn.php ├── Record.php ├── Record │ ├── Addr.php │ ├── Birt.php │ ├── Buri.php │ ├── Caln.php │ ├── Chan.php │ ├── Chr.php │ ├── Data.php │ ├── Date.php │ ├── Deat.php │ ├── Fam.php │ ├── Fam │ │ ├── Anul.php │ │ ├── Cens.php │ │ ├── Div.php │ │ ├── Enga.php │ │ ├── Even.php │ │ ├── Even │ │ │ ├── Husb.php │ │ │ └── Wife.php │ │ ├── Marb.php │ │ ├── Marc.php │ │ ├── Marl.php │ │ ├── Marr.php │ │ ├── Mars.php │ │ ├── Slgs.php │ │ └── Slgs │ │ │ └── Stat.php │ ├── Head.php │ ├── Head │ │ ├── Char.php │ │ ├── Date.php │ │ ├── Gedc.php │ │ ├── Plac.php │ │ ├── Sour.php │ │ └── Sour │ │ │ ├── Corp.php │ │ │ └── Data.php │ ├── Indi.php │ ├── Indi │ │ ├── Adop.php │ │ ├── Asso.php │ │ ├── Attr.php │ │ ├── Bapl.php │ │ ├── Bapm.php │ │ ├── Barm.php │ │ ├── Basm.php │ │ ├── Birt.php │ │ ├── Bles.php │ │ ├── Buri.php │ │ ├── Cast.php │ │ ├── Cens.php │ │ ├── Chr.php │ │ ├── Chra.php │ │ ├── Conf.php │ │ ├── Conl.php │ │ ├── Crem.php │ │ ├── Deat.php │ │ ├── Dscr.php │ │ ├── Educ.php │ │ ├── Emig.php │ │ ├── Endl.php │ │ ├── Even.php │ │ ├── Even │ │ │ └── Plac.php │ │ ├── Famc.php │ │ ├── Fams.php │ │ ├── Fcom.php │ │ ├── Grad.php │ │ ├── Idno.php │ │ ├── Immi.php │ │ ├── Lds.php │ │ ├── Name.php │ │ ├── Name │ │ │ ├── Fone.php │ │ │ └── Romn.php │ │ ├── Nati.php │ │ ├── Natu.php │ │ ├── Nchi.php │ │ ├── Nmr.php │ │ ├── Note.php │ │ ├── Occu.php │ │ ├── Ordn.php │ │ ├── Prob.php │ │ ├── Prop.php │ │ ├── Reli.php │ │ ├── Resi.php │ │ ├── Reti.php │ │ ├── Slgc.php │ │ ├── Ssn.php │ │ ├── Titl.php │ │ └── Will.php │ ├── Note.php │ ├── NoteRef.php │ ├── Noteable.php │ ├── Obje.php │ ├── ObjeRef.php │ ├── ObjeRef │ │ ├── File.php │ │ └── File │ │ │ └── Form.php │ ├── Objectable.php │ ├── Phon.php │ ├── Plac.php │ ├── Plac │ │ ├── Fone.php │ │ ├── Map.php │ │ └── Romn.php │ ├── Refn.php │ ├── Repo.php │ ├── RepoRef.php │ ├── Sour.php │ ├── Sour │ │ ├── Data.php │ │ ├── Data │ │ │ └── Even.php │ │ ├── Repo.php │ │ └── Repo │ │ │ └── Caln.php │ ├── SourRef.php │ ├── SourRef │ │ ├── Data.php │ │ └── Even.php │ ├── Sourceable.php │ ├── Subm.php │ └── Subn.php ├── Writer.php └── Writer │ ├── Addr.php │ ├── Caln.php │ ├── Chan.php │ ├── Fam.php │ ├── Fam │ ├── Even.php │ ├── Even │ │ ├── Husb.php │ │ └── Wife.php │ └── Slgs.php │ ├── Head.php │ ├── Head │ ├── Char.php │ ├── Date.php │ ├── Gedc.php │ ├── Plac.php │ ├── Sour.php │ └── Sour │ │ ├── Corp.php │ │ └── Data.php │ ├── Indi.php │ ├── Indi │ ├── Asso.php │ ├── Attr.php │ ├── Even.php │ ├── Even │ │ └── Plac.php │ ├── Famc.php │ ├── Fams.php │ └── Name.php │ ├── Note.php │ ├── NoteRef.php │ ├── Obje.php │ ├── ObjeRef.php │ ├── Phon.php │ ├── Refn.php │ ├── Repo.php │ ├── RepoRef.php │ ├── Sour.php │ ├── Sour │ ├── Data.php │ └── Data │ │ └── Even.php │ ├── SourRef.php │ ├── SourRef │ └── Even.php │ ├── Subm.php │ └── Subn.php └── tests ├── bootstrap.php ├── issue ├── Issue00012Test.php ├── Issue00017Test.php ├── Issue00018Test.php └── files │ ├── issue00012.ged │ ├── issue00017.ged │ └── issue00018.ged ├── library └── Gedcom │ └── ParserTest.php ├── phpunit.xml └── stresstestfiles ├── TGC551.ged ├── TGC551LF.ged ├── TGC55C.ged └── TGC55CLF.ged /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: familytree365 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | vendor/* 2 | .idea/* 3 | tmp/* -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.6 5 | - 5.5 6 | - 5.4 7 | - 7 8 | - hhvm 9 | - hhvm-nightly 10 | 11 | matrix: 12 | fast_finish: true 13 | allow_failures: 14 | - php: 7 15 | - php: hhvm 16 | - php: hhvm-nightly 17 | 18 | before_script: 19 | - composer install --prefer-dist --dev 20 | 21 | script: 22 | - vendor/bin/phpunit -c tests/phpunit.xml tests/ 23 | - vendor/bin/phpcs --standard=PSR2 -n library/ tests/ 24 | -------------------------------------------------------------------------------- /CONTRIBUTE.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are **welcome** and will be fully **credited**. We accept contributions via Pull Requests on [Github](https://github.com/familytree365/php-gedcom). 4 | 5 | ## Pull Requests 6 | 7 | - **[PSR-4 Coding Standard.]** The easiest way to apply the conventions is to install [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer). 8 | - **Document any change in behaviour.** Make sure the `README.md` and any other relevant documentation are kept up-to-date. 9 | - **Create feature branches.** Don't ask us to pull from your master branch. 10 | - **One pull request per feature.** If you want to do more than one thing, send multiple pull requests. 11 | - **Send coherent history.** Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 2 | 3 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 4 | 5 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cgdprojects/php-gedcom", 3 | "description": "A GEDCOM file parser (read + write) for PHP 8.0+", 4 | "type": "library", 5 | "keywords": ["gedcom","parser"], 6 | "homepage": "http://github.com/familytree365/php-gedcom", 7 | "license": "MIT", 8 | "require": { 9 | "php": ">=8.0" 10 | }, 11 | "require-dev": { 12 | "phpunit/phpunit": "9.*", 13 | "squizlabs/php_codesniffer": "3.6.*", 14 | "rector/rector": "^0.11.49" 15 | }, 16 | "autoload": { 17 | "psr-4": { 18 | "Gedcom\\": "src/" 19 | } 20 | }, 21 | "autoload-dev": { 22 | "psr-4": { 23 | "GedcomTest\\": "tests/" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /rector.php: -------------------------------------------------------------------------------- 1 | import(SetList::PHP_80); 11 | // get parameters 12 | $parameters = $containerConfigurator->parameters(); 13 | 14 | // Define what rule sets will be applied 15 | $containerConfigurator->import(SetList::DEAD_CODE); 16 | 17 | // get services (needed for register a single rule) 18 | // $services = $containerConfigurator->services(); 19 | 20 | // register a single rule 21 | // $services->set(TypedPropertyRector::class); 22 | }; 23 | -------------------------------------------------------------------------------- /src/Parser/Addr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser; 16 | 17 | class Addr extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | $line = isset($record[2]) ? trim($record[2]) : ''; 24 | 25 | $addr = new \Gedcom\Record\Addr(); 26 | $addr->setAddr($line); 27 | $parser->forward(); 28 | 29 | while (!$parser->eof()) { 30 | $record = $parser->getCurrentLineRecord(); 31 | $recordType = strtolower(trim($record[1])); 32 | $currentDepth = (int) $record[0]; 33 | 34 | if ($currentDepth <= $depth) { 35 | $parser->back(); 36 | break; 37 | } 38 | 39 | if ($addr->hasAttribute($recordType)) { 40 | $addr->{'set'.$recordType}(trim($record[2])); 41 | } else { 42 | if ($recordType == 'cont') { 43 | // FIXME: Can have CONT on multiple attributes 44 | $addr->setAddr($addr->getAddr()."\n"); 45 | if (isset($record[2])) { 46 | $addr->setAddr($addr->getAddr().trim($record[2])); 47 | } 48 | } else { 49 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 50 | } 51 | } 52 | 53 | $parser->forward(); 54 | } 55 | 56 | return $addr; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/Parser/Birt.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser; 16 | 17 | class Birt extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $parser->forward(); 25 | 26 | $birt = new \Gedcom\Record\Birt(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $recordType = trim($record[1]); 31 | $currentDepth = (int) $record[0]; 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'DATE': 40 | $birt->setDate(trim($record[2])); 41 | break; 42 | case '_DATI': 43 | $birt->setDati(trim($record[2])); 44 | break; 45 | case 'PLAC': 46 | $birt->setPlac(trim($record[2])); 47 | break; 48 | default: 49 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 50 | } 51 | 52 | $parser->forward(); 53 | } 54 | 55 | return $birt; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Parser/Buri.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser; 16 | 17 | class Buri extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $parser->forward(); 25 | 26 | $buri = new \Gedcom\Record\Buri(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $recordType = trim($record[1]); 31 | $currentDepth = (int) $record[0]; 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'DATE': 40 | $buri->setDate(trim($record[2])); 41 | break; 42 | case '_DATI': 43 | $buri->setDati(trim($record[2])); 44 | break; 45 | case 'PLAC': 46 | $buri->setPlac(trim($record[2])); 47 | break; 48 | default: 49 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 50 | } 51 | 52 | $parser->forward(); 53 | } 54 | 55 | return $buri; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Parser/Caln.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser; 16 | 17 | class Caln extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $identifier = $parser->normalizeIdentifier($record[2]); 25 | } else { 26 | $parser->skipToNextLevel($depth); 27 | 28 | return null; 29 | } 30 | 31 | $caln = new \Gedcom\Record\Caln(); 32 | $caln->setCaln($identifier); 33 | 34 | $parser->forward(); 35 | 36 | while (!$parser->eof()) { 37 | $record = $parser->getCurrentLineRecord(); 38 | $recordType = strtolower(trim($record[1])); 39 | $lineDepth = (int) $record[0]; 40 | 41 | if ($lineDepth <= $depth) { 42 | $parser->back(); 43 | break; 44 | } 45 | 46 | if ($caln->hasAttribute($recordType)) { 47 | $caln->{'set'.$recordType}(trim($record[2])); 48 | } else { 49 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 50 | } 51 | 52 | $parser->forward(); 53 | } 54 | 55 | return $caln; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Parser/Chan.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser; 16 | 17 | class Chan extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $parser->forward(); 25 | 26 | $chan = new \Gedcom\Record\Chan(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $recordType = trim($record[1]); 31 | $currentDepth = (int) $record[0]; 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'DATE': 40 | $chan->setDate(trim($record[2])); 41 | break; 42 | case 'TIME': 43 | $chan->setTime(trim($record[2])); 44 | break; 45 | case 'NOTE': 46 | $note = \Gedcom\Parser\NoteRef::parse($parser); 47 | if ($note) { 48 | $chan->addNote($note); 49 | } 50 | break; 51 | default: 52 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 53 | } 54 | 55 | $parser->forward(); 56 | } 57 | 58 | $date = $chan->getYear().'-'.$chan->getMonth().'-'.$chan->getDay(); 59 | $chan->setDatetime($date); 60 | 61 | return $chan; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/Parser/Chr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser; 16 | 17 | class Chr extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $parser->forward(); 25 | 26 | $chr = new \Gedcom\Record\Chr(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $recordType = trim($record[1]); 31 | $currentDepth = (int) $record[0]; 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'DATE': 40 | $chr->setDate(trim($record[2])); 41 | break; 42 | case 'PLAC': 43 | $chr->setPlac(trim($record[2])); 44 | break; 45 | default: 46 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 47 | } 48 | 49 | $parser->forward(); 50 | } 51 | 52 | return $chr; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Parser/Component.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser; 16 | 17 | abstract class Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Parser/Date.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser; 16 | 17 | class Date extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $parser->forward(); 25 | $record = $parser->getCurrentLineRecord(); 26 | 27 | if (isset($record[1])) { 28 | $dat = new \Gedcom\Record\Date(); 29 | if (!empty($record[2])) { 30 | $dat->setDate($record[2]); 31 | } 32 | } else { 33 | $parser->skipToNextLevel($depth); 34 | 35 | return null; 36 | } 37 | 38 | if ($dat->getYear() && $dat->getMonth() && $dat->getDay()) { 39 | return $dat->getYear().'-'.substr("0{$dat->getMonth()}", -2).'-'.substr("0{$dat->getDay()}", -2); 40 | } 41 | 42 | return $dat->getYear(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Parser/Deat.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser; 16 | 17 | class Deat extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $parser->forward(); 25 | 26 | $deat = new \Gedcom\Record\Deat(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $recordType = trim($record[1]); 31 | $currentDepth = (int) $record[0]; 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'DATE': 40 | $deat->setDate(trim($record[2])); 41 | break; 42 | case '_DATI': 43 | $deat->setDati(trim($record[2])); 44 | break; 45 | case 'PLAC': 46 | $deat->setPlac(trim($record[2])); 47 | break; 48 | case 'CAUS': 49 | $deat->setCaus(trim($record[2])); 50 | break; 51 | default: 52 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 53 | } 54 | 55 | $parser->forward(); 56 | } 57 | 58 | return $deat; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Parser/Fam/Anul.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Fam; 16 | 17 | class Anul extends \Gedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Fam/Cens.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Fam; 16 | 17 | class Cens extends \Gedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Fam/Div.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Fam; 16 | 17 | class Div extends \Gedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Fam/Divf.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Fam; 16 | 17 | class Divf extends \Gedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Fam/Enga.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Fam; 16 | 17 | class Enga extends \Gedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Fam/Even/Husb.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Fam\Even; 16 | 17 | class Husb extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $husband = new \Gedcom\Record\Fam\Even\Husb(); 25 | 26 | $parser->forward(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $recordType = strtoupper(trim($record[1])); 31 | $currentDepth = (int) $record[0]; 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'AGE': 40 | $husband->setAge(trim($record[2])); 41 | break; 42 | default: 43 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 44 | } 45 | 46 | $parser->forward(); 47 | } 48 | 49 | return $husband; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Parser/Fam/Even/Wife.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Fam\Even; 16 | 17 | class Wife extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $wife = new \Gedcom\Record\Fam\Even\Wife(); 25 | 26 | $parser->forward(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $recordType = strtoupper(trim($record[1])); 31 | $currentDepth = (int) $record[0]; 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'AGE': 40 | $wife->setAge(trim($record[2])); 41 | break; 42 | default: 43 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 44 | } 45 | 46 | $parser->forward(); 47 | } 48 | 49 | return $wife; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Parser/Fam/Marb.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Fam; 16 | 17 | class Marb extends \Gedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Fam/Marc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Fam; 16 | 17 | class Marc extends \Gedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Fam/Marl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Fam; 16 | 17 | class Marl extends \Gedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Fam/Marr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Fam; 16 | 17 | class Marr extends \Gedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Fam/Mars.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Fam; 16 | 17 | class Mars extends \Gedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Fam/Slgs/Stat.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Fam\Slgs; 16 | 17 | class Stat extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $_stat = $record[2]; 25 | } else { 26 | $parser->skipToNextLevel($depth); 27 | 28 | return null; 29 | } 30 | 31 | $stat = new \Gedcom\Record\Fam\Slgs\Stat(); 32 | $stat->setStat($_stat); 33 | 34 | $parser->forward(); 35 | 36 | while (!$parser->eof()) { 37 | $record = $parser->getCurrentLineRecord(); 38 | $recordType = strtoupper(trim($record[1])); 39 | $currentDepth = (int) $record[0]; 40 | 41 | if ($currentDepth <= $depth) { 42 | $parser->back(); 43 | break; 44 | } 45 | 46 | switch ($recordType) { 47 | case 'DATE': 48 | $stat->setDate(trim($record[2])); 49 | break; 50 | default: 51 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 52 | } 53 | 54 | $parser->forward(); 55 | } 56 | 57 | return $stat; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Parser/Head/Char.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Head; 16 | 17 | class Char extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $char = new \Gedcom\Record\Head\Char(); 25 | $char->setChar(trim($record[2])); 26 | } else { 27 | $parser->skipToNextLevel($depth); 28 | 29 | return null; 30 | } 31 | 32 | $parser->forward(); 33 | 34 | while (!$parser->eof()) { 35 | $record = $parser->getCurrentLineRecord(); 36 | $recordType = strtoupper(trim($record[1])); 37 | $currentDepth = (int) $record[0]; 38 | 39 | if ($currentDepth <= $depth) { 40 | $parser->back(); 41 | break; 42 | } 43 | 44 | switch ($recordType) { 45 | case 'VERS': 46 | $char->setVers(trim($record[2])); 47 | break; 48 | default: 49 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 50 | } 51 | 52 | $parser->forward(); 53 | } 54 | 55 | return $char; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Parser/Head/Date.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Head; 16 | 17 | class Date extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $date = new \Gedcom\Record\Head\Date(); 25 | $date->setDate(trim($record[2])); 26 | } else { 27 | $parser->skipToNextLevel($depth); 28 | 29 | return null; 30 | } 31 | 32 | $parser->forward(); 33 | 34 | while (!$parser->eof()) { 35 | $record = $parser->getCurrentLineRecord(); 36 | $recordType = strtoupper(trim($record[1])); 37 | $currentDepth = (int) $record[0]; 38 | 39 | if ($currentDepth <= $depth) { 40 | $parser->back(); 41 | break; 42 | } 43 | 44 | switch ($recordType) { 45 | case 'TIME': 46 | $date->setTime(trim($record[2])); 47 | break; 48 | default: 49 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 50 | } 51 | 52 | $parser->forward(); 53 | } 54 | 55 | return $date; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Parser/Head/Gedc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Head; 16 | 17 | class Gedc extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $gedc = new \Gedcom\Record\Head\Gedc(); 25 | 26 | $parser->forward(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $recordType = strtoupper(trim($record[1])); 31 | $currentDepth = (int) $record[0]; 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'VERS': 40 | $gedc->setVersion(trim($record[2])); 41 | break; 42 | case 'FORM': 43 | $gedc->setForm(trim($record[2])); 44 | break; 45 | default: 46 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 47 | } 48 | 49 | $parser->forward(); 50 | } 51 | 52 | return $gedc; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Parser/Head/Plac.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Head; 16 | 17 | class Plac extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $plac = new \Gedcom\Record\Head\Plac(); 25 | 26 | $parser->forward(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $recordType = strtoupper(trim($record[1])); 31 | $currentDepth = (int) $record[0]; 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'FORM': 40 | $plac->setForm(trim($record[2])); 41 | break; 42 | default: 43 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 44 | } 45 | 46 | $parser->forward(); 47 | } 48 | 49 | return $plac; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Parser/Head/Sour/Corp.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Head\Sour; 16 | 17 | class Corp extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $corp = new \Gedcom\Record\Head\Sour\Corp(); 25 | $corp->setCorp(trim($record[2])); 26 | } else { 27 | $parser->skipToNextLevel($depth); 28 | 29 | return null; 30 | } 31 | 32 | $parser->forward(); 33 | 34 | while (!$parser->eof()) { 35 | $record = $parser->getCurrentLineRecord(); 36 | $recordType = strtoupper(trim($record[1])); 37 | $currentDepth = (int) $record[0]; 38 | 39 | if ($currentDepth <= $depth) { 40 | $parser->back(); 41 | break; 42 | } 43 | 44 | switch ($recordType) { 45 | case 'ADDR': 46 | $corp->setAddr(\Gedcom\Parser\Addr::parse($parser)); 47 | break; 48 | case 'PHON': 49 | $corp->addPhon(trim($record[2])); 50 | break; 51 | default: 52 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 53 | } 54 | 55 | $parser->forward(); 56 | } 57 | 58 | return $corp; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Parser/Head/Sour/Data.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Head\Sour; 16 | 17 | class Data extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $data = new \Gedcom\Record\Head\Sour\Data(); 25 | $data->setData(trim($record[2])); 26 | } else { 27 | $parser->skipToNextLevel($depth); 28 | 29 | return null; 30 | } 31 | 32 | $parser->forward(); 33 | 34 | while (!$parser->eof()) { 35 | $record = $parser->getCurrentLineRecord(); 36 | $recordType = strtoupper(trim($record[1])); 37 | $currentDepth = (int) $record[0]; 38 | 39 | if ($currentDepth <= $depth) { 40 | $parser->back(); 41 | break; 42 | } 43 | 44 | switch ($recordType) { 45 | case 'DATE': 46 | $data->setDate(trim($record[2])); 47 | break; 48 | case 'COPR': 49 | $data->setCopr(trim($record[2])); 50 | break; 51 | default: 52 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 53 | } 54 | 55 | $parser->forward(); 56 | } 57 | 58 | return $data; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Parser/Indi/Adop.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Adop extends \Gedcom\Parser\Indi\Even 18 | { 19 | public static function parseAdop($parser, $even) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | if (isset($record[1])) { 23 | $even->setAdop(trim($record[2])); 24 | } 25 | } 26 | 27 | public static function parseFamc($parser, $even) 28 | { 29 | $record = $parser->getCurrentLineRecord(); 30 | if (isset($record[1])) { 31 | $even->setFamc(trim($record[2])); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Parser/Indi/Bapl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Bapl extends Lds 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Bapm.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Bapm extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Barm.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Barm extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Basm.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Basm extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Birt.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Birt extends \Gedcom\Parser\Indi\Even 18 | { 19 | public static function parseFamc($parser, $even) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | if (isset($record[2])) { 23 | $even->setFamc(trim($record[2])); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Parser/Indi/Bles.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Bles extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Buri.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Buri extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Cast.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Cast extends \Gedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Cens.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Cens extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Chr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Chr extends \Gedcom\Parser\Indi\Even 18 | { 19 | public static function parseFamc($parser, $even) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | if (isset($record[2])) { 23 | $even->setFamc(trim($record[2])); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Parser/Indi/Chra.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Chra extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Conf.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Conf extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Conl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Conl extends Lds 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Crem.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Crem extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Deat.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Deat extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Dscr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Dscr extends \Gedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Educ.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Educ extends \Gedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Emig.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Emig extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Endl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Endl extends Lds 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Even/Plac.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi\Even; 16 | 17 | class Plac extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $plac = new \Gedcom\Record\Indi\Even\Plac(); 25 | 26 | if (isset($record[2])) { 27 | $plac->setPlac(trim($record[2])); 28 | } 29 | 30 | $parser->forward(); 31 | 32 | while (!$parser->eof()) { 33 | $record = $parser->getCurrentLineRecord(); 34 | $recordType = strtoupper(trim($record[1])); 35 | $currentDepth = (int) $record[0]; 36 | 37 | if ($currentDepth <= $depth) { 38 | $parser->back(); 39 | break; 40 | } 41 | 42 | switch ($recordType) { 43 | case 'FORM': 44 | $plac->setForm(trim($record[2])); 45 | break; 46 | case 'NOTE': 47 | $note = \Gedcom\Parser\NoteRef::parse($parser); 48 | if ($note) { 49 | $plac->addNote($note); 50 | } 51 | break; 52 | case 'SOUR': 53 | $sour = \Gedcom\Parser\SourRef::parse($parser); 54 | $plac->addSour($sour); 55 | break; 56 | default: 57 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 58 | } 59 | 60 | $parser->forward(); 61 | } 62 | 63 | return $plac; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/Parser/Indi/Famc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Famc extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | if (count($record) < 3) { 25 | $parser->logSkippedRecord('Missing family information; '.self::class, ' @ '.__LINE__); 26 | $parser->skipToNextLevel($depth); 27 | 28 | return null; 29 | } 30 | 31 | $famc = $parser->normalizeIdentifier($record[2]); 32 | 33 | $fam = new \Gedcom\Record\Indi\Famc(); 34 | $fam->setFamc($famc); 35 | 36 | $parser->forward(); 37 | 38 | while (!$parser->eof()) { 39 | $record = $parser->getCurrentLineRecord(); 40 | $recordType = strtoupper(trim($record[1])); 41 | $currentDepth = (int) $record[0]; 42 | 43 | if ($currentDepth <= $depth) { 44 | $parser->back(); 45 | break; 46 | } 47 | 48 | switch ($recordType) { 49 | case 'PEDI': 50 | $fam->setPedi(trim($record[2])); 51 | break; 52 | case 'NOTE': 53 | $note = \Gedcom\Parser\NoteRef::parse($parser); 54 | if ($note) { 55 | $fam->addNote($note); 56 | } 57 | break; 58 | default: 59 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 60 | } 61 | 62 | $parser->forward(); 63 | } 64 | 65 | return $fam; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/Parser/Indi/Fams.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Fams extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | if (count($record) < 3) { 25 | $parser->logSkippedRecord('Missing family information; '.self::class, ' @ '.__LINE__); 26 | $parser->skipToNextLevel($depth); 27 | 28 | return null; 29 | } 30 | 31 | $fams = $parser->normalizeIdentifier($record[2]); 32 | 33 | $fam = new \Gedcom\Record\Indi\Fams(); 34 | $fam->setFams($fams); 35 | 36 | $parser->forward(); 37 | 38 | while (!$parser->eof()) { 39 | $record = $parser->getCurrentLineRecord(); 40 | $recordType = strtoupper(trim($record[1])); 41 | $currentDepth = (int) $record[0]; 42 | 43 | if ($currentDepth <= $depth) { 44 | $parser->back(); 45 | break; 46 | } 47 | 48 | switch ($recordType) { 49 | case 'NOTE': 50 | $note = \Gedcom\Parser\NoteRef::parse($parser); 51 | if ($note) { 52 | $fam->addNote($note); 53 | } 54 | break; 55 | default: 56 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 57 | } 58 | 59 | $parser->forward(); 60 | } 61 | 62 | return $fam; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/Parser/Indi/Fcom.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Fcom extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Grad.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Grad extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Idno.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Idno extends \Gedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Immi.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Immi extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Nati.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Nati extends \Gedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Natu.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Natu extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Nchi.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Nchi extends \Gedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Nmr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Nmr extends \Gedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Occu.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Occu extends \Gedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Ordn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Ordn extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Prob.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Prob extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Prop.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Prop extends \Gedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Reli.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Reli extends \Gedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Resi.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Resi extends \Gedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Reti.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Reti extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Slgc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Slgc extends Lds 18 | { 19 | public static function parseFamc($parser, $slgc) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $slgc->setFamc($parser->normalizeIdentifier($record[2])); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Parser/Indi/Ssn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Ssn extends \Gedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Titl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Titl extends \Gedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/Indi/Will.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Indi; 16 | 17 | class Will extends \Gedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Parser/ObjeRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser; 16 | 17 | class ObjeRef extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $obje = new \Gedcom\Record\ObjeRef(); 25 | 26 | if (isset($record[2])) { 27 | $obje->setIsReference(true); 28 | $obje->setObje($parser->normalizeIdentifier($record[2])); 29 | } else { 30 | $obje->setIsReference(false); 31 | } 32 | 33 | $parser->forward(); 34 | 35 | while (!$parser->eof()) { 36 | $record = $parser->getCurrentLineRecord(); 37 | $recordType = strtoupper(trim($record[1])); 38 | $currentDepth = (int) $record[0]; 39 | 40 | if ($currentDepth <= $depth) { 41 | $parser->back(); 42 | break; 43 | } 44 | 45 | switch ($recordType) { 46 | case 'TITL': 47 | $obje->setTitl(trim($record[2])); 48 | break; 49 | case 'FILE': 50 | $obje->setFile(\Gedcom\Parser\ObjeRef\File::parse($parser)); 51 | break; 52 | default: 53 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 54 | } 55 | 56 | $parser->forward(); 57 | } 58 | 59 | return $obje; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/Parser/ObjeRef/File.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\ObjeRef; 16 | 17 | class File extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $file = new \Gedcom\Record\ObjeRef\File(); 22 | $record = $parser->getCurrentLineRecord(); 23 | $depth = (int) $record[0]; 24 | if (isset($record[2])) { 25 | $file->setFile($record[2]); 26 | } else { 27 | return null; 28 | } 29 | $parser->forward(); 30 | 31 | while (!$parser->eof()) { 32 | $record = $parser->getCurrentLineRecord(); 33 | $recordType = strtoupper(trim($record[1])); 34 | $currentDepth = (int) $record[0]; 35 | 36 | if ($currentDepth <= $depth) { 37 | $parser->back(); 38 | break; 39 | } 40 | 41 | switch ($recordType) { 42 | case 'FORM': 43 | $file->setDate(\Parser\ObjeRef\File\Form::parse($parser)); 44 | break; 45 | case 'TITL': 46 | $file->setTitl(trim($record[2])); 47 | default: 48 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 49 | } 50 | 51 | $parser->forward(); 52 | } 53 | 54 | return $file; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/Parser/ObjeRef/File/Form.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\ObjeRef\File; 16 | 17 | class Form extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $form = new \Gedcom\Record\ObjeRef\File\Form(); 22 | $record = $parser->getCurrentLineRecord(); 23 | $depth = (int) $record[0]; 24 | if (isset($record[2])) { 25 | $form->setForm($record[2]); 26 | } else { 27 | $parser->skipToNextLevel($depth); 28 | 29 | return null; 30 | } 31 | $parser->forward(); 32 | 33 | while (!$parser->eof()) { 34 | $record = $parser->getCurrentLineRecord(); 35 | $recordType = strtoupper(trim($record[1])); 36 | $currentDepth = (int) $record[0]; 37 | 38 | if ($currentDepth <= $depth) { 39 | $parser->back(); 40 | break; 41 | } 42 | 43 | switch ($recordType) { 44 | case 'MEDI': 45 | $form->setMedi(trim($record[2])); 46 | break; 47 | case 'TYPE': 48 | $form->setType(trim($record[2])); 49 | break; 50 | default: 51 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 52 | } 53 | 54 | $parser->forward(); 55 | } 56 | 57 | return $form; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Parser/Phon.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser; 16 | 17 | class Phon extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $phone = new \Gedcom\Record\Phon(); 25 | $phone->setPhon(trim($record[2])); 26 | } else { 27 | $parser->skipToNextLevel($depth); 28 | 29 | return null; 30 | } 31 | 32 | $parser->forward(); 33 | 34 | while (!$parser->eof()) { 35 | $record = $parser->getCurrentLineRecord(); 36 | $recordType = strtoupper(trim($record[1])); 37 | $currentDepth = (int) $record[0]; 38 | 39 | if ($currentDepth <= $depth) { 40 | $parser->back(); 41 | break; 42 | } 43 | 44 | switch ($recordType) { 45 | default: 46 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 47 | } 48 | 49 | $parser->forward(); 50 | } 51 | 52 | return $phone; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Parser/Plac/Fone.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Plac; 16 | 17 | class Fone extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $_fone = trim($record[2]); 25 | } else { 26 | $parser->skipToNextLevel($depth); 27 | 28 | return null; 29 | } 30 | 31 | $fone = new \Gedcom\Record\Plac\Fone(); 32 | $fone->setPlac($_fone); 33 | 34 | $parser->forward(); 35 | 36 | while (!$parser->eof()) { 37 | $record = $parser->getCurrentLineRecord(); 38 | $currentDepth = (int) $record[0]; 39 | $recordType = strtoupper(trim($record[1])); 40 | 41 | if ($currentDepth <= $depth) { 42 | $parser->back(); 43 | break; 44 | } 45 | 46 | switch ($recordType) { 47 | case 'TYPE': 48 | $fone->setType(trim($record[2])); 49 | break; 50 | default: 51 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 52 | } 53 | 54 | $parser->forward(); 55 | } 56 | 57 | return $fone; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Parser/Plac/Map.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Plac; 16 | 17 | class Map extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $map = new \Gedcom\Record\Plac\Map(); 25 | 26 | $parser->forward(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $currentDepth = (int) $record[0]; 31 | $recordType = strtoupper(trim($record[1])); 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'LATI': 40 | $map->setLati(trim($record[2])); 41 | break; 42 | case 'LONG': 43 | $map->setLong(trim($record[2])); 44 | break; 45 | default: 46 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 47 | } 48 | 49 | $parser->forward(); 50 | } 51 | 52 | return $map; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Parser/Plac/Romn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Plac; 16 | 17 | class Romn extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $_romn = trim($record[2]); 25 | } else { 26 | $parser->skipToNextLevel($depth); 27 | 28 | return null; 29 | } 30 | 31 | $romn = new \Gedcom\Record\Plac\Romn(); 32 | $romn->setPlac($_romn); 33 | 34 | $parser->forward(); 35 | 36 | while (!$parser->eof()) { 37 | $record = $parser->getCurrentLineRecord(); 38 | $currentDepth = (int) $record[0]; 39 | $recordType = strtoupper(trim($record[1])); 40 | 41 | if ($currentDepth <= $depth) { 42 | $parser->back(); 43 | break; 44 | } 45 | 46 | switch ($recordType) { 47 | case 'TYPE': 48 | $romn->setType(trim($record[2])); 49 | break; 50 | default: 51 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 52 | } 53 | 54 | $parser->forward(); 55 | } 56 | 57 | return $romn; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Parser/Refn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser; 16 | 17 | class Refn extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $refn = new \Gedcom\Record\Refn(); 25 | $refn->setRefn(trim($record[2])); 26 | } else { 27 | $parser->skipToNextLevel($depth); 28 | 29 | return null; 30 | } 31 | 32 | $parser->forward(); 33 | 34 | while (!$parser->eof()) { 35 | $record = $parser->getCurrentLineRecord(); 36 | $recordType = strtoupper(trim($record[1])); 37 | $currentDepth = (int) $record[0]; 38 | 39 | if ($currentDepth <= $depth) { 40 | $parser->back(); 41 | break; 42 | } 43 | 44 | switch ($recordType) { 45 | case 'TYPE': 46 | $refn->setType(trim($record[2])); 47 | break; 48 | default: 49 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 50 | } 51 | 52 | $parser->forward(); 53 | } 54 | 55 | return $refn; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Parser/RepoRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser; 16 | 17 | class RepoRef extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $identifier = $parser->normalizeIdentifier($record[2]); 25 | } else { 26 | $parser->skipToNextLevel($depth); 27 | 28 | return null; 29 | } 30 | 31 | $repo = new \Gedcom\Record\RepoRef(); 32 | $repo->setRepo($identifier); 33 | 34 | $parser->forward(); 35 | 36 | while (!$parser->eof()) { 37 | $record = $parser->getCurrentLineRecord(); 38 | $currentDepth = (int) $record[0]; 39 | $recordType = strtoupper(trim($record[1])); 40 | 41 | if ($currentDepth <= $depth) { 42 | $parser->back(); 43 | break; 44 | } 45 | 46 | switch ($recordType) { 47 | case 'CALN': 48 | $repo->addCaln(\Parser\Caln::parse($parser)); 49 | break; 50 | case 'NOTE': 51 | $note = \Gedcom\Parser\NoteRef::parse($parser); 52 | if ($note) { 53 | $repo->addNote($note); 54 | } 55 | break; 56 | default: 57 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 58 | } 59 | 60 | $parser->forward(); 61 | } 62 | 63 | return $repo; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/Parser/Sour/Data/Even.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Sour\Data; 16 | 17 | class Even extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $even = new \Gedcom\Record\Sour\Data\Even(); 25 | 26 | $parser->forward(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $recordType = strtoupper(trim($record[1])); 31 | $currentDepth = (int) $record[0]; 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'DATE': 40 | $even->setDate(trim($record[2])); 41 | break; 42 | case 'PLAC': 43 | $even->setPlac(trim($record[2])); 44 | break; 45 | default: 46 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 47 | } 48 | 49 | $parser->forward(); 50 | } 51 | 52 | return $even; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Parser/Sour/Repo.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Sour; 16 | 17 | class Repo extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $repo = new \Gedcom\Record\Sour\Repo(); 22 | $record = $parser->getCurrentLineRecord(); 23 | $depth = (int) $record[0]; 24 | if (isset($record[2])) { 25 | $_repo = $parser->normalizeIdentifier($record[2]); 26 | $repo->setRepo($_repo); 27 | } 28 | 29 | $parser->forward(); 30 | 31 | while (!$parser->eof()) { 32 | $record = $parser->getCurrentLineRecord(); 33 | $recordType = strtoupper(trim($record[1])); 34 | $currentDepth = (int) $record[0]; 35 | 36 | if ($currentDepth <= $depth) { 37 | $parser->back(); 38 | break; 39 | } 40 | 41 | switch ($recordType) { 42 | case 'NOTE': 43 | $repo->addNote(\Gedcom\Parser\NoteRef::parse($parser)); 44 | break; 45 | case 'CALN': 46 | $repo->addCaln(\Gedcom\Parser\Sour\Repo\Caln::parse($parser)); 47 | break; 48 | default: 49 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 50 | } 51 | 52 | $parser->forward(); 53 | } 54 | 55 | return $repo; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Parser/Sour/Repo/Caln.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\Sour\Repo; 16 | 17 | class Caln extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $caln = new \Gedcom\Record\Sour\Repo\Caln(); 22 | $record = $parser->getCurrentLineRecord(); 23 | $depth = (int) $record[0]; 24 | if (isset($record[2])) { 25 | $_caln = $record[2]; 26 | $caln->setCaln($_caln); 27 | } else { 28 | return null; 29 | } 30 | 31 | $parser->forward(); 32 | 33 | while (!$parser->eof()) { 34 | $record = $parser->getCurrentLineRecord(); 35 | $recordType = strtoupper(trim($record[1])); 36 | $currentDepth = (int) $record[0]; 37 | 38 | if ($currentDepth <= $depth) { 39 | $parser->back(); 40 | break; 41 | } 42 | 43 | switch ($recordType) { 44 | case 'MEDI': 45 | $caln->setMedi(trim($record[2])); 46 | break; 47 | default: 48 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 49 | } 50 | 51 | $parser->forward(); 52 | } 53 | 54 | return $caln; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/Parser/SourRef/Data.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\SourRef; 16 | 17 | class Data extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $data = new \Gedcom\Record\SourRef\Data(); 22 | $record = $parser->getCurrentLineRecord(); 23 | $depth = (int) $record[0]; 24 | 25 | $parser->forward(); 26 | 27 | while (!$parser->eof()) { 28 | $record = $parser->getCurrentLineRecord(); 29 | $recordType = strtoupper(trim($record[1])); 30 | $currentDepth = (int) $record[0]; 31 | 32 | if ($currentDepth <= $depth) { 33 | $parser->back(); 34 | break; 35 | } 36 | 37 | switch ($recordType) { 38 | case 'DATE': 39 | $data->setDate(trim($record[2])); 40 | break; 41 | case 'TEXT': 42 | $data->setText($parser->parseMultiLineRecord()); 43 | break; 44 | default: 45 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 46 | } 47 | 48 | $parser->forward(); 49 | } 50 | 51 | return $data; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/Parser/SourRef/Even.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Parser\SourRef; 16 | 17 | class Even extends \Gedcom\Parser\Component 18 | { 19 | public static function parse(\Gedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $even = new \Gedcom\Record\SourRef\Even(); 25 | $even->setEven(trim($record[2])); 26 | } else { 27 | $parser->skipToNextLevel($depth); 28 | 29 | return null; 30 | } 31 | 32 | $parser->forward(); 33 | 34 | while (!$parser->eof()) { 35 | $record = $parser->getCurrentLineRecord(); 36 | $recordType = strtoupper(trim($record[1])); 37 | $currentDepth = (int) $record[0]; 38 | 39 | if ($currentDepth <= $depth) { 40 | $parser->back(); 41 | break; 42 | } 43 | 44 | switch ($recordType) { 45 | case 'ROLE': 46 | $even->setRole(trim($record[2])); 47 | break; 48 | default: 49 | $parser->logUnhandledRecord(self::class.' @ '.__LINE__); 50 | } 51 | 52 | $parser->forward(); 53 | } 54 | 55 | return $even; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Record/Caln.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record; 16 | 17 | /** 18 | * Class Caln. 19 | */ 20 | class Caln extends \Gedcom\Record 21 | { 22 | /** 23 | * @var string 24 | */ 25 | protected $caln; 26 | 27 | /** 28 | * @var string 29 | */ 30 | protected $medi; 31 | 32 | /** 33 | * @param string $caln 34 | * 35 | * @return Caln 36 | */ 37 | public function setCaln($caln = '') 38 | { 39 | $this->caln = $caln; 40 | 41 | return $this; 42 | } 43 | 44 | /** 45 | * @return string 46 | */ 47 | public function getCaln() 48 | { 49 | return $this->caln; 50 | } 51 | 52 | /** 53 | * @param string $medi 54 | * 55 | * @return Caln 56 | */ 57 | public function setMedi($medi = '') 58 | { 59 | $this->medi = $medi; 60 | 61 | return $this; 62 | } 63 | 64 | /** 65 | * @return string 66 | */ 67 | public function getMedi() 68 | { 69 | return $this->medi; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/Record/Data.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record; 16 | 17 | /** 18 | * Class Data. 19 | */ 20 | class Data extends \Gedcom\Record 21 | { 22 | /** 23 | * @var string 24 | */ 25 | protected $text; 26 | 27 | /** 28 | * @var string 29 | */ 30 | protected $date; 31 | 32 | /** 33 | * @param string $text 34 | * 35 | * @return Data 36 | */ 37 | public function setText($text = '') 38 | { 39 | $this->text = $text; 40 | 41 | return $this; 42 | } 43 | 44 | /** 45 | * @return string 46 | */ 47 | public function getText() 48 | { 49 | return $this->text; 50 | } 51 | 52 | /** 53 | * @param string $date 54 | * 55 | * @return Data 56 | */ 57 | public function setDate($date = '') 58 | { 59 | $this->date = $date; 60 | 61 | return $this; 62 | } 63 | 64 | /** 65 | * @return string 66 | */ 67 | public function getDate() 68 | { 69 | return $this->date; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/Record/Fam.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record; 16 | 17 | class Fam extends \Gedcom\Record implements Noteable, Sourceable, Objectable 18 | { 19 | protected $_id; 20 | 21 | protected $_resn; 22 | 23 | protected $_even = []; 24 | 25 | protected $_husb; 26 | 27 | protected $_wife; 28 | 29 | protected $_chil = []; 30 | 31 | protected $_nchi; 32 | 33 | protected $_subm = []; 34 | 35 | protected $_slgs = []; 36 | 37 | protected $_refn = []; 38 | 39 | protected $_rin; 40 | 41 | protected $_chan; 42 | 43 | protected $_note = []; 44 | 45 | protected $_sour = []; 46 | 47 | protected $_obje = []; 48 | 49 | public function addEven($even) 50 | { 51 | $this->_even[$even->getType()] = $even; 52 | } 53 | 54 | /** 55 | * @return array 56 | */ 57 | public function getAllEven() 58 | { 59 | return $this->_even; 60 | } 61 | 62 | /** 63 | * @return void|\Gedcom\Record\Fam\Even 64 | */ 65 | public function getEven($key = '') 66 | { 67 | if (isset($this->_even[strtoupper($key)])) { 68 | return $this->_even[strtoupper($key)]; 69 | } 70 | } 71 | 72 | public function addSlgs($slgs = []) 73 | { 74 | $this->_slgs[] = $slgs; 75 | } 76 | 77 | public function addRefn($refn = []) 78 | { 79 | $this->_refn[] = $refn; 80 | } 81 | 82 | public function addNote($note = []) 83 | { 84 | $this->_note[] = $note; 85 | } 86 | 87 | public function addSour($sour = []) 88 | { 89 | $this->_sour[] = $sour; 90 | } 91 | 92 | public function addObje($obje = []) 93 | { 94 | $this->_obje[] = $obje; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/Record/Fam/Anul.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Fam; 16 | 17 | class Anul extends \Gedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Fam/Cens.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Fam; 16 | 17 | class Cens extends \Gedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Fam/Div.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Fam; 16 | 17 | class Div extends \Gedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Fam/Enga.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Fam; 16 | 17 | class Enga extends \Gedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Fam/Even/Husb.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Fam\Even; 16 | 17 | class Husb extends \Gedcom\Record 18 | { 19 | protected $_age; 20 | } 21 | -------------------------------------------------------------------------------- /src/Record/Fam/Even/Wife.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Fam\Even; 16 | 17 | class Wife extends \Gedcom\Record 18 | { 19 | protected $_age; 20 | } 21 | -------------------------------------------------------------------------------- /src/Record/Fam/Marb.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Fam; 16 | 17 | class Marb extends \Gedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Fam/Marc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Fam; 16 | 17 | class Marc extends \Gedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Fam/Marl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Fam; 16 | 17 | class Marl extends \Gedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Fam/Marr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Fam; 16 | 17 | class Marr extends \Gedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Fam/Mars.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Fam; 16 | 17 | class Mars extends \Gedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Fam/Slgs.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Fam; 16 | 17 | use Gedcom\Record\Noteable; 18 | use Gedcom\Record\Sourceable; 19 | 20 | class Slgs extends \Gedcom\Record implements Sourceable, Noteable 21 | { 22 | protected $_stat; 23 | protected $_date; 24 | protected $_plac; 25 | protected $_temp; 26 | 27 | protected $_sour = []; 28 | 29 | protected $_note = []; 30 | 31 | public function addSour($sour = []) 32 | { 33 | $this->_sour[] = $sour; 34 | } 35 | 36 | public function addNote($note = []) 37 | { 38 | $this->_note[] = $note; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Record/Fam/Slgs/Stat.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Head; 16 | 17 | class Char extends \Gedcom\Record 18 | { 19 | protected $_char; 20 | protected $_vers; 21 | } 22 | -------------------------------------------------------------------------------- /src/Record/Head/Date.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Head; 16 | 17 | class Date extends \Gedcom\Record 18 | { 19 | protected $_date; 20 | protected $_time; 21 | } 22 | -------------------------------------------------------------------------------- /src/Record/Head/Gedc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Head; 16 | 17 | class Gedc extends \Gedcom\Record 18 | { 19 | protected $_vers; 20 | 21 | protected $_form; 22 | 23 | /** 24 | * @return Gedc/version 25 | */ 26 | public function getVersion() 27 | { 28 | return $this->_vers; 29 | } 30 | 31 | /** 32 | * @param Gedc/version 33 | */ 34 | public function setVersion($vers = []) 35 | { 36 | $this->_vers = $vers; 37 | } 38 | 39 | /** 40 | * @return Gedc/form 41 | */ 42 | public function getForm() 43 | { 44 | return $this->_form; 45 | } 46 | 47 | /** 48 | * @param Gedc/version 49 | */ 50 | public function setForm($form = []) 51 | { 52 | $this->_form = $form; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Record/Head/Plac.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Head; 16 | 17 | class Plac extends \Gedcom\Record 18 | { 19 | protected $_form; 20 | } 21 | -------------------------------------------------------------------------------- /src/Record/Head/Sour.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Head; 16 | 17 | class Sour extends \Gedcom\Record 18 | { 19 | protected $_sour; 20 | 21 | protected $_vers; 22 | 23 | protected $_name; 24 | 25 | protected $_corp; 26 | 27 | protected $_data; 28 | 29 | /** 30 | * @param Sour\Corp $corp 31 | */ 32 | public function setCorp($corp = []) 33 | { 34 | $this->_corp = $corp; 35 | } 36 | 37 | /** 38 | * @return Sour\Corp 39 | */ 40 | public function getCorp() 41 | { 42 | return $this->_corp; 43 | } 44 | 45 | /** 46 | * @param \Gedcom\Record\Head\Sour\Data $data 47 | */ 48 | public function setData($data = []) 49 | { 50 | $this->_data = $data; 51 | } 52 | 53 | /** 54 | * @return \Gedcom\Record\Head\Sour\Data 55 | */ 56 | public function getData() 57 | { 58 | return $this->_data; 59 | } 60 | 61 | /** 62 | * @return Sour\Name 63 | */ 64 | public function getName() 65 | { 66 | return $this->_name; 67 | } 68 | 69 | /** 70 | * @param Sour\Name 71 | */ 72 | public function setName($name = []) 73 | { 74 | $this->_name = $name; 75 | } 76 | 77 | /** 78 | * @return Sour\Version 79 | */ 80 | public function getVersion() 81 | { 82 | return $this->_vers; 83 | } 84 | 85 | /** 86 | * @param Sour\Version 87 | */ 88 | public function setVersion($version = []) 89 | { 90 | $this->_vers = $version; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/Record/Head/Sour/Corp.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Head\Sour; 16 | 17 | class Corp extends \Gedcom\Record 18 | { 19 | protected $_corp; 20 | protected $_addr; 21 | 22 | protected $_phon = []; 23 | 24 | public function addPhon($phon = []) 25 | { 26 | $this->_phon[] = $phon; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Record/Head/Sour/Data.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Head\Sour; 16 | 17 | class Data extends \Gedcom\Record 18 | { 19 | protected $_data; 20 | protected $_date; 21 | protected $_copr; 22 | } 23 | -------------------------------------------------------------------------------- /src/Record/Indi/Adop.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Adop extends \Gedcom\Record\Indi\Even 18 | { 19 | protected $_adop; 20 | protected $_famc; 21 | } 22 | -------------------------------------------------------------------------------- /src/Record/Indi/Asso.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | use Gedcom\Record\Noteable; 18 | use Gedcom\Record\Sourceable; 19 | 20 | class Asso extends \Gedcom\Record implements Sourceable, Noteable 21 | { 22 | protected $_indi; 23 | protected $_rela; 24 | 25 | protected $_note = []; 26 | 27 | protected $_sour = []; 28 | 29 | public function addNote($note = []) 30 | { 31 | $this->_note[] = $note; 32 | } 33 | 34 | public function addSour($sour = []) 35 | { 36 | $this->_sour[] = $sour; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Record/Indi/Attr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | use Gedcom\Record\Noteable; 18 | use Gedcom\Record\Objectable; 19 | use Gedcom\Record\Sourceable; 20 | 21 | class Attr extends \Gedcom\Record\Indi\Even implements Sourceable, Noteable, Objectable 22 | { 23 | protected $type; 24 | protected $_attr; 25 | 26 | protected $sour = []; 27 | 28 | protected $note = []; 29 | 30 | protected $obje = []; 31 | 32 | public function addSour($sour = []) 33 | { 34 | $this->sour[] = $sour; 35 | } 36 | 37 | public function addNote($note = []) 38 | { 39 | $this->note[] = $note; 40 | } 41 | 42 | public function addObje($obje = []) 43 | { 44 | $this->obje[] = $obje; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Record/Indi/Bapl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Bapl extends Lds 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Bapm.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Bapm extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Barm.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Barm extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Basm.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Basm extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Birt.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | /** 18 | * Class Birt. 19 | */ 20 | class Birt extends Even 21 | { 22 | /** 23 | * @var string 24 | */ 25 | protected $famc; 26 | 27 | /** 28 | * @param string $famc 29 | * 30 | * @return Birt 31 | */ 32 | public function setFamc($famc = '') 33 | { 34 | $this->famc = $famc; 35 | 36 | return $this; 37 | } 38 | 39 | /** 40 | * @return string 41 | */ 42 | public function getFamc() 43 | { 44 | return $this->famc; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Record/Indi/Bles.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Bles extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Buri.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Buri extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Cast.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Cast extends \Gedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Cens.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Cens extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Chr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Chr extends \Gedcom\Record\Indi\Even 18 | { 19 | protected $_famc; 20 | } 21 | -------------------------------------------------------------------------------- /src/Record/Indi/Chra.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Chra extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Conf.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Conf extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Conl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Conl extends Lds 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Crem.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Crem extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Deat.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Deat extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Dscr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Dscr extends \Gedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Educ.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Educ extends \Gedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Emig.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Emig extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Endl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Endl extends Lds 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Famc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | use Gedcom\Record\Noteable; 18 | 19 | class Famc extends \Gedcom\Record implements Noteable 20 | { 21 | protected $_famc; 22 | protected $_pedi; 23 | 24 | protected $_note = []; 25 | 26 | public function addNote($note = []) 27 | { 28 | $this->_note[] = $note; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Record/Indi/Fams.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | use Gedcom\Record\Noteable; 18 | 19 | class Fams extends \Gedcom\Record implements Noteable 20 | { 21 | protected $_fams; 22 | 23 | protected $_note = []; 24 | 25 | public function addNote($note = []) 26 | { 27 | $this->_note[] = $note; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Record/Indi/Fcom.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Fcom extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Grad.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Grad extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Idno.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Idno extends \Gedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Immi.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Immi extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Lds.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | use Gedcom\Record\Noteable; 18 | use Gedcom\Record\Sourceable; 19 | 20 | abstract class Lds extends \Gedcom\Record implements Sourceable, Noteable 21 | { 22 | protected $_stat; 23 | protected $_date; 24 | protected $_plac; 25 | protected $_temp; 26 | 27 | protected $_sour = []; 28 | 29 | protected $_note = []; 30 | 31 | public function addSour($sour = []) 32 | { 33 | $this->_sour[] = $sour; 34 | } 35 | 36 | public function addNote($note = []) 37 | { 38 | $this->_note[] = $note; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Record/Indi/Name.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | /** 18 | * @method string getName() 19 | * @method string getNpfx() 20 | * @method string getGivn() 21 | * @method string getNick() 22 | * @method string getSpfx() 23 | * @method string getSurn() 24 | * @method string getNsfx() 25 | */ 26 | class Name extends \Gedcom\Record implements \Gedcom\Record\Sourceable 27 | { 28 | protected $_name; 29 | protected $_npfx; 30 | protected $_givn; 31 | protected $_nick; 32 | protected $_spfx; 33 | protected $_surn; 34 | protected $_nsfx; 35 | protected $_fone; // Gedcom/ 36 | protected $_romn; 37 | protected $_type; 38 | 39 | protected $_note = []; 40 | 41 | protected $_sour = []; 42 | 43 | public function addSour($sour = []) 44 | { 45 | $this->_sour[] = $sour; 46 | } 47 | 48 | public function addNote($note = []) 49 | { 50 | $this->_note[] = $note; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Record/Indi/Name/Fone.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi\Name; 16 | 17 | /** 18 | * Class Refn. 19 | */ 20 | class Fone extends \Gedcom\Record 21 | { 22 | /** 23 | * @var string phonetic_variation 24 | */ 25 | protected $fone; 26 | 27 | /** 28 | * @var string phonetic_type 29 | */ 30 | protected $type; 31 | /** 32 | * string name_piece_prefix. 33 | */ 34 | protected $_npfx; 35 | /** 36 | * string name_piece_given. 37 | */ 38 | protected $_givn; 39 | /** 40 | * string name_piece_nickname. 41 | */ 42 | protected $_nick; 43 | /** 44 | * strign name_piece_surname_prefix. 45 | */ 46 | protected $_spfx; 47 | /** 48 | * string name_piece_surname. 49 | */ 50 | protected $_surn; 51 | /** 52 | * string name_piece_suffix. 53 | */ 54 | protected $_nsfx; 55 | 56 | /** 57 | * PhpRecord\NoteRef. 58 | */ 59 | protected $_note = []; 60 | 61 | /** 62 | * PhpRecord\SourRef. 63 | */ 64 | protected $_sour = []; 65 | 66 | public function addSour($sour = []) 67 | { 68 | $this->_sour[] = $sour; 69 | } 70 | 71 | public function addNote($note = []) 72 | { 73 | $this->_note[] = $note; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/Record/Indi/Name/Romn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi\Name; 16 | 17 | /** 18 | * Class Refn. 19 | */ 20 | class Romn extends \Gedcom\Record 21 | { 22 | /** 23 | * @var string romanized_variation 24 | */ 25 | protected $romn; 26 | 27 | /** 28 | * @var string romanized_type 29 | */ 30 | protected $type; 31 | /** 32 | * string name_piece_prefix. 33 | */ 34 | protected $_npfx; 35 | /** 36 | * string name_piece_given. 37 | */ 38 | protected $_givn; 39 | /** 40 | * string name_piece_nickname. 41 | */ 42 | protected $_nick; 43 | /** 44 | * strign name_piece_surname_prefix. 45 | */ 46 | protected $_spfx; 47 | /** 48 | * string name_piece_surname. 49 | */ 50 | protected $_surn; 51 | /** 52 | * string name_piece_suffix. 53 | */ 54 | protected $_nsfx; 55 | 56 | /** 57 | * PhpRecord\NoteRef. 58 | */ 59 | protected $_note = []; 60 | 61 | /** 62 | * PhpRecord\SourRef. 63 | */ 64 | protected $_sour = []; 65 | 66 | public function addSour($sour = []) 67 | { 68 | $this->_sour[] = $sour; 69 | } 70 | 71 | public function addNote($note = []) 72 | { 73 | $this->_note[] = $note; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/Record/Indi/Nati.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Nati extends \Gedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Natu.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Natu extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Nchi.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Nchi extends \Gedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Nmr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Nmr extends \Gedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Note.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Note extends \Gedcom\Record\NoteRefAbstract 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Occu.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Occu extends \Gedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Ordn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Ordn extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Prob.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Prob extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Prop.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Prop extends \Gedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Reli.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Reli extends \Gedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Resi.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Resi extends \Gedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Reti.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Reti extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Slgc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Slgc extends Lds 18 | { 19 | protected $_famc; 20 | } 21 | -------------------------------------------------------------------------------- /src/Record/Indi/Ssn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Ssn extends \Gedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Titl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Titl extends \Gedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Indi/Will.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Indi; 16 | 17 | class Will extends \Gedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/Record/Note.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record; 16 | 17 | class Note extends \Gedcom\Record implements Sourceable 18 | { 19 | protected $_id; 20 | protected $_note; 21 | 22 | protected $_even; 23 | protected $_refn = []; 24 | protected $_rin; 25 | 26 | protected $_sour = []; 27 | protected $_chan; 28 | 29 | public function addRefn($refn = []) 30 | { 31 | $this->_refn[] = $refn; 32 | } 33 | 34 | public function addSour($sour = []) 35 | { 36 | $this->_sour[] = $sour; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Record/NoteRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record; 16 | 17 | class NoteRef extends \Gedcom\Record implements Sourceable 18 | { 19 | protected $_isRef = false; 20 | 21 | protected $_note = ''; 22 | 23 | protected $_sour = []; 24 | 25 | public function setIsReference($isReference = true) 26 | { 27 | $this->_isRef = $isReference; 28 | } 29 | 30 | public function getIsReference() 31 | { 32 | return $this->_isRef; 33 | } 34 | 35 | public function addSour($sour = []) 36 | { 37 | $this->_sour[] = $sour; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Record/Noteable.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record; 16 | 17 | interface Noteable 18 | { 19 | public function addNote($note = []); 20 | } 21 | -------------------------------------------------------------------------------- /src/Record/Obje.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record; 16 | 17 | class Obje extends \Gedcom\Record implements Noteable 18 | { 19 | protected $_id; 20 | 21 | protected $_file = []; 22 | protected $_rin; 23 | protected $_chan; 24 | 25 | protected $_refn = []; 26 | 27 | protected $_note = []; 28 | 29 | protected $_sour = []; 30 | 31 | public function addRefn($refn = []) 32 | { 33 | $this->_refn[] = $refn; 34 | } 35 | 36 | public function addNote($note = []) 37 | { 38 | $this->_note[] = $note; 39 | } 40 | 41 | public function addFile($file) 42 | { 43 | $this->_file[] = $file; 44 | } 45 | 46 | public function addSour($sour) 47 | { 48 | $this->_sour[] = $sour; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Record/ObjeRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record; 16 | 17 | class ObjeRef extends \Gedcom\Record 18 | { 19 | protected $_isRef = false; 20 | 21 | protected $_obje; 22 | 23 | protected $_titl; 24 | 25 | protected $_file; 26 | 27 | public function setIsReference($isReference = true) 28 | { 29 | $this->_isRef = $isReference; 30 | } 31 | 32 | public function getIsReference() 33 | { 34 | return $this->_isRef; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Record/ObjeRef/File.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\ObjeRef; 16 | 17 | /** 18 | * Class Refn. 19 | */ 20 | class File extends \Gedcom\Record 21 | { 22 | /** 23 | * @var string multimedia_file_refn 24 | */ 25 | protected $_file; 26 | 27 | /** 28 | * @var PhpRecord\ObjeRef\File\Form 29 | */ 30 | protected $_form; 31 | protected $_titl; 32 | } 33 | -------------------------------------------------------------------------------- /src/Record/ObjeRef/File/Form.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\ObjeRef\File; 16 | 17 | /** 18 | * Class Refn. 19 | */ 20 | class Form extends \Gedcom\Record 21 | { 22 | /** 23 | * @var string multimedia_format 24 | */ 25 | protected $form; 26 | 27 | /** 28 | * @var string source_media_type 29 | * for only obje 30 | */ 31 | protected $type; 32 | 33 | /** 34 | * @var string source_media_type 35 | * for only objeref 36 | */ 37 | protected $medi; 38 | } 39 | -------------------------------------------------------------------------------- /src/Record/Objectable.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record; 16 | 17 | interface Objectable 18 | { 19 | public function addObje($obje = []); 20 | } 21 | -------------------------------------------------------------------------------- /src/Record/Phon.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record; 16 | 17 | /** 18 | * Class Phon. 19 | */ 20 | class Phon extends \Gedcom\Record 21 | { 22 | /** 23 | * @var string 24 | */ 25 | protected $phon; 26 | 27 | /** 28 | * @param $phon 29 | * 30 | * @return Phon 31 | */ 32 | public function setPhon($phon = []) 33 | { 34 | $this->phon = $phon; 35 | 36 | return $this; 37 | } 38 | 39 | /** 40 | * @return null|string 41 | */ 42 | public function getPhon() 43 | { 44 | return $this->phon; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Record/Plac.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record; 16 | 17 | class Plac extends \Gedcom\Record implements Noteable 18 | { 19 | /** 20 | * string plac. 21 | */ 22 | protected $_plac; 23 | /** 24 | * string place_hierarchy. 25 | */ 26 | protected $_form; 27 | /** 28 | * array PhpRecord\Plac\Fone. 29 | */ 30 | protected $_fone; 31 | /** 32 | * array PhpRecord\Plac\Romn. 33 | */ 34 | protected $_romn; 35 | /** 36 | * PhpRecord\Plac\Map. 37 | */ 38 | protected $_map; 39 | /** 40 | * array PhpRecord\NoteRef. 41 | */ 42 | protected $_note; 43 | 44 | /** 45 | * @param PhpRecord\NoteRef $note 46 | * 47 | * @return Plac 48 | */ 49 | public function addNote($note = null) 50 | { 51 | $this->_note[] = $note; 52 | 53 | return $this; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Record/Plac/Fone.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Plac; 16 | 17 | /** 18 | * Class Refn. 19 | */ 20 | class Fone extends \Gedcom\Record 21 | { 22 | /** 23 | * @var string phonetic_variation 24 | */ 25 | protected $_fone; 26 | 27 | /** 28 | * @var string phonetic_type 29 | */ 30 | protected $_type; 31 | } 32 | -------------------------------------------------------------------------------- /src/Record/Plac/Map.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Plac; 16 | 17 | /** 18 | * Class Refn. 19 | */ 20 | class Map extends \Gedcom\Record 21 | { 22 | /** 23 | * @var string place_latitude 24 | */ 25 | protected $lati; 26 | 27 | /** 28 | * @var string place_longitude 29 | */ 30 | protected $long; 31 | 32 | /** 33 | * @param string $lati 34 | * 35 | * @return Map 36 | */ 37 | public function setLati($lati = '') 38 | { 39 | $this->lati = $lati; 40 | 41 | return $this; 42 | } 43 | 44 | /** 45 | * @param string $long 46 | * 47 | * @return Map 48 | */ 49 | public function setLong($long = '') 50 | { 51 | $this->long = $long; 52 | 53 | return $this; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Record/Plac/Romn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Plac; 16 | 17 | /** 18 | * Class Refn. 19 | */ 20 | class Romn extends \Gedcom\Record 21 | { 22 | /** 23 | * @var string romanized_variation 24 | */ 25 | protected $romn; 26 | 27 | /** 28 | * @var string romanized_type 29 | */ 30 | protected $type; 31 | } 32 | -------------------------------------------------------------------------------- /src/Record/Refn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record; 16 | 17 | /** 18 | * Class Refn. 19 | */ 20 | class Refn extends \Gedcom\Record 21 | { 22 | /** 23 | * @var string 24 | */ 25 | protected $refn; 26 | 27 | /** 28 | * @var string 29 | */ 30 | protected $type; 31 | 32 | /** 33 | * @param string $refn 34 | * 35 | * @return Refn 36 | */ 37 | public function setRefn($refn = '') 38 | { 39 | $this->refn = $refn; 40 | 41 | return $this; 42 | } 43 | 44 | /** 45 | * @return string 46 | */ 47 | public function getRefn() 48 | { 49 | return $this->refn; 50 | } 51 | 52 | /** 53 | * @param string $type 54 | * 55 | * @return Refn 56 | */ 57 | public function setType($type = '') 58 | { 59 | $this->type = $type; 60 | 61 | return $this; 62 | } 63 | 64 | /** 65 | * @return string 66 | */ 67 | public function getType() 68 | { 69 | return $this->type; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/Record/RepoRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record; 16 | 17 | class RepoRef extends \Gedcom\Record implements Noteable 18 | { 19 | protected $_repo; 20 | 21 | protected $_caln = []; 22 | 23 | protected $_note = []; 24 | 25 | public function addNote($note = []) 26 | { 27 | $this->_note[] = $note; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Record/Sour/Data.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Sour; 16 | 17 | use Gedcom\Record\Noteable; 18 | 19 | class Data extends \Gedcom\Record implements Noteable 20 | { 21 | protected $_even = []; 22 | protected $_agnc; 23 | protected $_date; 24 | 25 | protected $_text; 26 | 27 | protected $_note = []; 28 | 29 | public function addNote($note = []) 30 | { 31 | $this->_note[] = $note; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Record/Sour/Data/Even.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Sour\Data; 16 | 17 | class Even extends \Gedcom\Record 18 | { 19 | protected $_date; 20 | protected $_plac; 21 | } 22 | -------------------------------------------------------------------------------- /src/Record/Sour/Repo.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Sour; 16 | 17 | use Gedcom\Record\Noteable; 18 | 19 | class Repo extends \Gedcom\Record implements Noteable 20 | { 21 | protected $_repo; 22 | /** 23 | * array PhpRecord\Sour\Repo\Caln. 24 | */ 25 | protected $_caln = []; 26 | 27 | /** 28 | * array PhpRecord\NoteRef. 29 | */ 30 | protected $_note = []; 31 | 32 | public function addNote($note = []) 33 | { 34 | $this->_note[] = $note; 35 | } 36 | 37 | public function addCaln($caln = []) 38 | { 39 | $this->_caln[] = $caln; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Record/Sour/Repo/Caln.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\Sour\Repo; 16 | 17 | class Caln extends \Gedcom\Record 18 | { 19 | /** 20 | * string source_call_number. 21 | */ 22 | protected $_caln; 23 | /** 24 | * string source_media_type. 25 | */ 26 | protected $_medi; 27 | } 28 | -------------------------------------------------------------------------------- /src/Record/SourRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record; 16 | 17 | class SourRef extends \Gedcom\Record 18 | { 19 | protected $_isRef = false; 20 | 21 | protected $_sour; 22 | protected $_page; 23 | protected $_even; 24 | protected $_data; 25 | protected $_quay; 26 | protected $_text; 27 | 28 | protected $_obje = []; 29 | protected $_note = []; 30 | 31 | public function setSour($sour = '') 32 | { 33 | $this->_sour = $sour; 34 | 35 | return $this; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Record/SourRef/Data.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\SourRef; 16 | 17 | class Data extends \Gedcom\Record 18 | { 19 | /** 20 | * string entry_recording_date. 21 | */ 22 | protected $_date; 23 | /** 24 | * string text_from_source. 25 | */ 26 | protected $_text; 27 | } 28 | -------------------------------------------------------------------------------- /src/Record/SourRef/Even.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record\SourRef; 16 | 17 | class Even extends \Gedcom\Record 18 | { 19 | protected $_even; 20 | protected $_role; 21 | } 22 | -------------------------------------------------------------------------------- /src/Record/Sourceable.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Record; 16 | 17 | interface Sourceable 18 | { 19 | public function addSour($sour = []); 20 | } 21 | -------------------------------------------------------------------------------- /src/Writer/Addr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer; 16 | 17 | class Addr 18 | { 19 | /** 20 | * @param string $format 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\Addr &$addr, $format = self::GEDCOM55, $level = 1) 26 | { 27 | $addrs = explode("\n", $addr->getAddr()); 28 | 29 | $output = "{$level} ADDR ".$addrs[0]."\n"; 30 | 31 | array_shift($addrs); 32 | 33 | foreach ($addrs as $cont) { 34 | $output .= ($level + 1).' CONT '.$cont."\n"; 35 | } 36 | 37 | return $output.(($level + 1).' ADR1 '.$addr->adr1."\n". 38 | ($level + 1).' ADR2 '.$addr->getAdr2()."\n". 39 | ($level + 1).' CITY '.$addr->getCity()."\n". 40 | ($level + 1).' STAE '.$addr->getStae()."\n". 41 | ($level + 1).' POST '.$addr->getPost()."\n". 42 | ($level + 1).' CTRY '.$addr->getCtry()."\n"); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Writer/Caln.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer; 16 | 17 | class Caln 18 | { 19 | /** 20 | * @param \Gedcom\Record\Caln $note 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\Caln &$caln, $level) 26 | { 27 | $output = ''; 28 | $_caln = $caln->getCaln(); 29 | if (empty($_caln)) { 30 | return $output; 31 | } else { 32 | $output .= $level.' CALN '.$_caln."\n"; 33 | } 34 | 35 | // level up 36 | $level++; 37 | 38 | // medi 39 | $medi = $caln->getMedi(); 40 | if (!empty($medi)) { 41 | $output .= $level.' MEDI '.$medi."\n"; 42 | } 43 | 44 | return $output; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Writer/Chan.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer; 16 | 17 | class Chan 18 | { 19 | /** 20 | * @param \Gedcom\Record\Chan $note 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\Chan &$chan, $level) 26 | { 27 | $output = $level." CHAN \n"; 28 | // level up 29 | $level++; 30 | // DATE 31 | $_date = $chan->getDate(); 32 | if (!empty($_date)) { 33 | $output .= $level.' DATE '.$_date."\n"; 34 | } 35 | // TIME 36 | $_time = $chan->getDate(); 37 | if (!empty($_time)) { 38 | $output .= $level.' DATE '.$_time."\n"; 39 | } 40 | // $_note = array() 41 | $_note = $chan->getNote(); 42 | if (!empty($_note) && count($_note) > 0) { 43 | foreach ($_note as $item) { 44 | $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); 45 | $output .= $_convert; 46 | } 47 | } 48 | 49 | return $output; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Writer/Fam/Even/Husb.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Fam\Even; 16 | 17 | class Husb 18 | { 19 | /** 20 | * @param \Gedcom\Record\Fam\Even\Husb $attr 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\Fam\Even\Husb &$husb, $level = 0) 26 | { 27 | $output = ''; 28 | 29 | $output .= $level." WIFE \n"; 30 | // level up 31 | $level++; 32 | 33 | // AGE 34 | $age = $husb->getAge(); 35 | if (!empty($age)) { 36 | $output .= $level.' AGE '.$age."\n"; 37 | } 38 | 39 | return $output; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Writer/Fam/Even/Wife.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Fam\Even; 16 | 17 | class Wife 18 | { 19 | /** 20 | * @param \Gedcom\Record\Fam\Even\Wife $attr 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\Fam\Even\Wife &$wife, $level = 0) 26 | { 27 | $output = ''; 28 | 29 | $output .= $level." HUSB \n"; 30 | // level up 31 | $level++; 32 | 33 | // AGE 34 | $age = $wife->getAge(); 35 | if (!empty($age)) { 36 | $output .= $level.' AGE '.$age."\n"; 37 | } 38 | 39 | return $output; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Writer/Fam/Slgs.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Fam; 16 | 17 | class Slgs 18 | { 19 | /** 20 | * @param int $level 21 | * 22 | * @return string 23 | */ 24 | public static function convert(\Gedcom\Record\Fam\Slgs &$slgs, $level) 25 | { 26 | $output = ''; 27 | $output .= $level." SLGS \n"; 28 | 29 | // Level up 30 | $level++; 31 | 32 | // $STAT; 33 | $stat = $slgs->getStat(); 34 | if (!empty($stat)) { 35 | $output .= $level.' STAT '.$stat."\n"; 36 | } 37 | 38 | // $date; 39 | $date = $slgs->getDate(); 40 | if (!empty($date)) { 41 | $output .= $level.' DATE '.$date."\n"; 42 | } 43 | 44 | // PLAC 45 | $plac = $slgs->getPlac(); 46 | if (!empty($plac)) { 47 | $output .= $level.' PLAC '.$plac."\n"; 48 | } 49 | 50 | // $TEMP; 51 | $temp = $slgs->getTemp(); 52 | if (!empty($temp)) { 53 | $output .= $level.' TEMP '.$temp."\n"; 54 | } 55 | 56 | // $sour = array(); 57 | $sour = $slgs->getSour(); 58 | if (!empty($sour) && count($sour) > 0) { 59 | foreach ($sour as $item) { 60 | $_convert = \Gedcom\Writer\SourRef::convert($item, $level); 61 | $output .= $_convert; 62 | } 63 | } 64 | // $note = array(); 65 | $note = $slgs->getNote(); 66 | if (!empty($note) && count($note) > 0) { 67 | foreach ($note as $item) { 68 | $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); 69 | $output .= $_convert; 70 | } 71 | } 72 | 73 | return $output; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/Writer/Head/Char.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Head; 16 | 17 | class Char 18 | { 19 | /** 20 | * @param string $format 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\Head\Char &$char, $level) 26 | { 27 | $output = ''; 28 | // char 29 | $_char = $char->getChar(); 30 | if ($_char) { 31 | $output .= $level.' CHAR '.$_char."\n"; 32 | } else { 33 | return $output; 34 | } 35 | 36 | // level up 37 | $level++; 38 | // VERS 39 | $vers = $char->getVersion(); 40 | if ($vers) { 41 | $output .= $level.' VERS '.$vers."\n"; 42 | } 43 | 44 | return $output; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Writer/Head/Date.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Head; 16 | 17 | class Date 18 | { 19 | /** 20 | * @param string $format 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\Head\Date &$date, $level) 26 | { 27 | $output = ''; 28 | $_date = $date->getDate(); 29 | if ($_date) { 30 | $output .= $level.' DATE '.$_date."\n"; 31 | } else { 32 | return $output; 33 | } 34 | 35 | // level up 36 | $level++; 37 | // Time 38 | $time = $date->getTime(); 39 | if ($time) { 40 | $output .= $level.' TIME '.$time."\n"; 41 | } 42 | 43 | return $output; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Writer/Head/Gedc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Head; 16 | 17 | class Gedc 18 | { 19 | /** 20 | * @param string $format 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\Head\Gedc &$gedc, $level) 26 | { 27 | $output = $level." GEDC \n"; 28 | 29 | // level up 30 | $level++; 31 | // VERS 32 | $vers = $gedc->getVersion(); 33 | if ($vers) { 34 | $output .= $level.' VERS '.$vers."\n"; 35 | } 36 | 37 | // FORM 38 | $form = $gedc->getForm(); 39 | if ($form) { 40 | $output .= $level.' FORM '.$form."\n"; 41 | } 42 | 43 | return $output; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Writer/Head/Plac.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Head; 16 | 17 | class Plac 18 | { 19 | /** 20 | * @param string $format 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\Head\Plac &$plac, $level) 26 | { 27 | $output = $level." PLAC \n"; 28 | 29 | // level up 30 | $level++; 31 | // FORM 32 | $form = $plac->getForm(); 33 | if ($form) { 34 | $output .= $level.' FORM '.$form."\n"; 35 | } 36 | 37 | return $output; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Writer/Head/Sour.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Head; 16 | 17 | class Sour 18 | { 19 | /** 20 | * @param string $format 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\Head\Sour &$sour, $level) 26 | { 27 | $output = ''; 28 | $_sour = $sour->getSour(); 29 | if ($_sour) { 30 | $output .= $level.' SOUR '.$_sour."\n"; 31 | } else { 32 | return $output; 33 | } 34 | 35 | // level up 36 | $level++; 37 | 38 | // VERS 39 | $vers = $sour->getVersion(); 40 | if ($vers) { 41 | $output .= $level.' VERS '.$vers."\n"; 42 | } 43 | 44 | // NAME 45 | $name = $sour->getName(); 46 | if ($name) { 47 | $output .= $level.' NAME '.$name."\n"; 48 | } 49 | 50 | // CORP 51 | $corp = $sour->getCorp(); 52 | if ($corp) { 53 | $_convert = \Gedcom\Writer\Head\Sour\Corp::convert($corp, $level); 54 | $output .= $_convert; 55 | } 56 | 57 | // DATA 58 | $data = $sour->getData(); 59 | if ($data) { 60 | $_convert = \Gedcom\Writer\Head\Sour\Data::convert($data, $level); 61 | $output .= $_convert; 62 | } 63 | 64 | return $output; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/Writer/Head/Sour/Corp.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Head\Sour; 16 | 17 | class Corp 18 | { 19 | /** 20 | * @param string $format 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\Head\Sour\Corp &$corp, $level) 26 | { 27 | $output = ''; 28 | $_corp = $corp->getCorp(); 29 | if ($_corp) { 30 | $output .= $level.' CORP '.$_corp."\n"; 31 | } else { 32 | return $output; 33 | } 34 | 35 | // level up 36 | $level++; 37 | 38 | // ADDR 39 | $addr = $corp->getAddr(); 40 | if ($addr) { 41 | $_convert = \Gedcom\Writer\Addr::convert($addr, $level); 42 | $output .= $_convert; 43 | } 44 | 45 | // phon 46 | $phon = $corp->getPhon(); 47 | if ($phon && count($phon) > 0) { 48 | foreach ($phon as $item) { 49 | if ($item) { 50 | $_convert = \Gedcom\Writer\Phon::convert($item, $level); 51 | $output .= $_convert; 52 | } 53 | } 54 | } 55 | 56 | return $output; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/Writer/Head/Sour/Data.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Head\Sour; 16 | 17 | class Data 18 | { 19 | /** 20 | * @param string $format 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\Head\Sour\Data &$data, $level) 26 | { 27 | $output = ''; 28 | $_data = $data->getData(); 29 | if ($_data) { 30 | $output .= $level.' DATA '.$_data."\n"; 31 | } else { 32 | return $output; 33 | } 34 | 35 | // level up 36 | $level++; 37 | 38 | // DATE 39 | $date = $corp->getDate(); 40 | if ($date) { 41 | $output .= $level.' DATE '.$date."\n"; 42 | } 43 | 44 | // COPR 45 | $corp = $corp->getCorp(); 46 | if ($corp) { 47 | $output .= $level.' COPR '.$corp."\n"; 48 | } 49 | 50 | return $output; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Writer/Indi/Asso.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Indi; 16 | 17 | class Asso 18 | { 19 | /** 20 | * @param \Gedcom\Record\Indi\Asso $attr 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\Indi\Asso &$asso, $level = 0) 26 | { 27 | $output = ''; 28 | // _indi 29 | $_indi = $asso->getIndi(); 30 | if (empty($_indi)) { 31 | return $output; 32 | } 33 | $output .= $level.' ASSO '.$_indi."\n"; 34 | // level up 35 | $level++; 36 | 37 | // RELA 38 | $rela = $asso->getRela(); 39 | if (!empty($rela)) { 40 | $output .= $level.' RELA '.$rela."\n"; 41 | } 42 | // sour 43 | $sour = $asso->getSour(); 44 | if (!empty($sour) && count($sour) > 0) { 45 | foreach ($sour as $item) { 46 | $_convert = \Gedcom\Writer\SourRef::convert($item, $level); 47 | $output .= $_convert; 48 | } 49 | } 50 | 51 | // note 52 | $note = $asso->getSour(); 53 | if (!empty($note) && count($note) > 0) { 54 | foreach ($note as $item) { 55 | $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); 56 | $output .= $_convert; 57 | } 58 | } 59 | 60 | return $output; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/Writer/Indi/Attr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Indi; 16 | 17 | class Attr 18 | { 19 | /** 20 | * @param int $level 21 | * 22 | * @return string 23 | */ 24 | public static function convert(\Gedcom\Record\Indi\Attr &$attr, $level = 0) 25 | { 26 | return ''; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Writer/Indi/Even/Plac.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Indi\Even; 16 | 17 | class Plac 18 | { 19 | /** 20 | * @param int $level 21 | * 22 | * @return string 23 | */ 24 | public static function convert(\Gedcom\Record\Indi\Even\Plac &$plac, $level = 0) 25 | { 26 | $output = ''; 27 | 28 | // $plac 29 | $_plac = $plac->getPlac(); 30 | if (!empty($_plac)) { 31 | $output .= $level.' PLAC '.$_plac."\n"; 32 | } else { 33 | $output .= $level." PLAC\n"; 34 | } 35 | 36 | // level up 37 | $level++; 38 | 39 | // $form 40 | $form = $plac->getForm(); 41 | if (!empty($form)) { 42 | $output .= $level.' FORM '.$form."\n"; 43 | } 44 | 45 | // $note -array 46 | $note = $plac->getNote(); 47 | if ($note && count($note) > 0) { 48 | foreach ($note as $item) { 49 | $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); 50 | $output .= $_convert; 51 | } 52 | } 53 | // $sour -array 54 | $sour = $plac->getSour(); 55 | if ($sour && count($sour) > 0) { 56 | foreach ($sour as $item) { 57 | $_convert = \Gedcom\Writer\SourRef::convert($item, $level); 58 | $output .= $_convert; 59 | } 60 | } 61 | 62 | return $output; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/Writer/Indi/Famc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Indi; 16 | 17 | class Famc 18 | { 19 | /** 20 | * @param \Gedcom\Record\Indi\Famc $attr 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\Indi\Famc &$famc, $level = 0) 26 | { 27 | $output = ''; 28 | // NAME 29 | $_famc = $famc->getFams(); 30 | if (empty($_fams)) { 31 | return $output; 32 | } 33 | $output .= $level.' FAMC @'.$_famc."@\n"; 34 | // level up 35 | $level++; 36 | 37 | // PEDI 38 | $pedi = $famc->getPedi(); 39 | if (!empty($pedi)) { 40 | $output .= $level.' PEDI '.$pedi."\n"; 41 | } 42 | 43 | // note 44 | $note = $famc->getSour(); 45 | if (!empty($note) && count($note) > 0) { 46 | foreach ($note as $item) { 47 | $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); 48 | $output .= $_convert; 49 | } 50 | } 51 | 52 | return $output; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Writer/Indi/Fams.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Indi; 16 | 17 | class Fams 18 | { 19 | /** 20 | * @param \Gedcom\Record\Indi\Fams $attr 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\Indi\Fams &$fams, $level = 0) 26 | { 27 | $output = ''; 28 | // NAME 29 | $_fams = $fams->getFams(); 30 | if (empty($_fams)) { 31 | return $output; 32 | } 33 | $output .= $level.' FAMS @'.$_fams."@\n"; 34 | // level up 35 | $level++; 36 | 37 | // note 38 | $note = $fams->getNote(); 39 | if (!empty($note) && count($note) > 0) { 40 | foreach ($note as $item) { 41 | $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); 42 | $output .= $_convert; 43 | } 44 | } 45 | 46 | return $output; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Writer/NoteRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer; 16 | 17 | class NoteRef 18 | { 19 | /** 20 | * @param int $level 21 | * 22 | * @return string 23 | */ 24 | public static function convert(\Gedcom\Record\NoteRef &$note, $level) 25 | { 26 | $output = ''; 27 | 28 | // $_note 29 | $_note = $note->getNote(); 30 | if (!empty($_note)) { 31 | $output .= $level.' NOTE '.$_note."\n"; 32 | } 33 | 34 | $level++; 35 | // $sour 36 | $sour = $note->getSour(); 37 | if ($sour && count($sour) > 0) { 38 | foreach ($sour as $item) { 39 | $_convert = \Gedcom\Writer\SourRef::convert($item, $level); 40 | $output .= $_convert; 41 | } 42 | } 43 | 44 | return $output; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Writer/ObjeRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer; 16 | 17 | class ObjeRef 18 | { 19 | /** 20 | * @param \Gedcom\Record\ObjeRef $note 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\ObjeRef &$obje, $level) 26 | { 27 | $output = ''; 28 | 29 | // $_note 30 | $_obje = $obje->getObje(); 31 | if (!empty($_note)) { 32 | $output .= $level.' OBJE '.$_obje."\n"; 33 | } else { 34 | $output .= $level." OBJE \n"; 35 | } 36 | 37 | $level++; 38 | // _form 39 | $_form = $obje->getForm(); 40 | if (!empty($_form)) { 41 | $output .= $level.' FORM '.$_form."\n"; 42 | } 43 | 44 | // _titl 45 | $_titl = $obje->getTitl(); 46 | if (!empty($_titl)) { 47 | $output .= $level.' TITL '.$_titl."\n"; 48 | } 49 | 50 | // _file 51 | $_file = $obje->getFile(); 52 | if (!empty($_file)) { 53 | $output .= $level.' FILE '.$_file."\n"; 54 | } 55 | 56 | // $_note = array() 57 | $_note = $obje->getNote(); 58 | if (!empty($_note) && count($_note) > 0) { 59 | foreach ($_note as $item) { 60 | $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); 61 | $output .= $_convert; 62 | } 63 | } 64 | 65 | return $output; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/Writer/Phon.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer; 16 | 17 | class Phon 18 | { 19 | /** 20 | * @param string $phon 21 | * @param string $format 22 | * @param int $level 23 | * 24 | * @return string 25 | */ 26 | public static function convert($phon, $level = 1) 27 | { 28 | return "{$level} PHON ".$phon."\n"; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Writer/Refn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer; 16 | 17 | class Refn 18 | { 19 | /** 20 | * @param \Gedcom\Record\Refn $note 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\Gedcom\Record\Refn &$refn, $level) 26 | { 27 | $output = ''; 28 | $_refn = $refn->getRefn(); 29 | if (empty($_refn)) { 30 | return $output; 31 | } else { 32 | $output .= $level.' REFN '.$_refn."\n"; 33 | } 34 | // level up 35 | $level++; 36 | // DATE 37 | $type = $refn->getType(); 38 | if (!empty($type)) { 39 | $output .= $level.' TYPE '.$type."\n"; 40 | } 41 | 42 | return $output; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Writer/RepoRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer; 16 | 17 | class RepoRef 18 | { 19 | /** 20 | * @param int $level 21 | * 22 | * @return string 23 | */ 24 | public static function convert(\Gedcom\Record\RepoRef &$reporef, $level) 25 | { 26 | $output = ''; 27 | $_repo = $reporef->getRepo(); 28 | if (empty($_sour)) { 29 | return $output; 30 | } else { 31 | $output .= $level.' REPO '.$_repo."\n"; 32 | } 33 | // level up 34 | $level++; 35 | 36 | // Note array 37 | $note = $reporef->getNote(); 38 | if (!empty($note) && count($note) > 0) { 39 | foreach ($note as $item) { 40 | $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); 41 | $output .= $_convert; 42 | } 43 | } 44 | 45 | // _caln array 46 | $_caln = $reporef->getCaln(); 47 | if (!empty($_caln) && count($_caln) > 0) { 48 | foreach ($_caln as $item) { 49 | $_convert = \Gedcom\Writer\Caln::convert($item, $level); 50 | $output .= $_convert; 51 | } 52 | } 53 | 54 | return $output; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/Writer/Sour/Data.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Sour; 16 | 17 | class Data 18 | { 19 | /** 20 | * @param int $level 21 | * 22 | * @return string 23 | */ 24 | public static function convert(\Gedcom\Record\Sour\Data &$data, $level = 0) 25 | { 26 | $output = $level." DATA\n"; 27 | $level++; 28 | 29 | // $_date; 30 | $date = $data->getDate(); 31 | if (!empty($date)) { 32 | $output .= $level.' DATE '.$date."\n"; 33 | } 34 | 35 | // $_agnc AGNC 36 | $_agnc = $data->getAgnc(); 37 | if (!empty($_agnc)) { 38 | $output .= $level.' AGNC '.$_agnc."\n"; 39 | } 40 | 41 | // $_text 42 | $_text = $data->getText(); 43 | if (!empty($_text)) { 44 | $output .= $level.' TEXT '.$_text."\n"; 45 | } 46 | 47 | // $_note 48 | $note = $data->getNote(); 49 | if ($note && count($note) > 0) { 50 | foreach ($note as $item) { 51 | $_convert = \Gedcom\Writer\NoteRef::convert($item, $level); 52 | $output .= $_convert; 53 | } 54 | } 55 | 56 | // $_even 57 | $_even = $data->getEven(); 58 | if ($_even && count($_even) > 0) { 59 | foreach ($_even as $item) { 60 | $_convert = \Gedcom\Writer\Sour\Data\Even::convert($item, $level); 61 | $output .= $_convert; 62 | } 63 | } 64 | 65 | return $output; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/Writer/Sour/Data/Even.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\Sour\Data; 16 | 17 | class Even 18 | { 19 | /** 20 | * @param int $level 21 | * 22 | * @return string 23 | */ 24 | public static function convert(\Gedcom\Record\Sour\Data\Even &$even, $level) 25 | { 26 | $output = $level." EVEN\n"; 27 | $level++; 28 | 29 | // $date; 30 | $date = $even->getDate(); 31 | if (!empty($date)) { 32 | $output .= $level.' DATE '.$date."\n"; 33 | } 34 | 35 | // Plac 36 | $plac = $even->getPlac(); 37 | if (!empty($plac)) { 38 | $output .= $level.' PLAC '.$plac."\n"; 39 | } 40 | 41 | return $output; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Writer/SourRef/Even.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace Gedcom\Writer\SourRef; 16 | 17 | class Even 18 | { 19 | /** 20 | * @param int $level 21 | * 22 | * @return string 23 | */ 24 | public static function convert(\Gedcom\Record\SourRef\Even &$even, $level = 0) 25 | { 26 | $output = ''; 27 | 28 | // $_date; 29 | $_even = $even->getEven(); 30 | if (!empty($_even)) { 31 | $output .= $level.' EVEN '.$_even."\n"; 32 | } else { 33 | $output = $level." EVEN\n"; 34 | } 35 | // level up 36 | $level++; 37 | 38 | // $_role ROLE 39 | $_role = $data->getRole(); 40 | if (!empty($_role)) { 41 | $output .= $level.' ROLE '.$_role."\n"; 42 | } 43 | 44 | return $output; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | parse($sample); 18 | 19 | $indi = current($gedcom->getIndi()); 20 | $birt = current($indi->getEven()); 21 | 22 | $this->assertEquals('01.01.1970', $birt->getDate()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tests/issue/Issue00017Test.php: -------------------------------------------------------------------------------- 1 | parse($sample); 21 | 22 | $indi = current($gedcom->getIndi()); 23 | 24 | $this->assertCount(0, $indi->getFamc()); 25 | $this->assertCount(1, $parser->getErrors()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tests/issue/Issue00018Test.php: -------------------------------------------------------------------------------- 1 | parse($sample); 21 | 22 | $sour = current($gedcom->getSour()); 23 | 24 | $this->assertCount(0, $sour->getNote()); 25 | $this->assertCount(1, $parser->getErrors()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tests/issue/files/issue00012.ged: -------------------------------------------------------------------------------- 1 | 0 @I53561612@ INDI 2 | 1 NAME XXX XX /XXXX/ 3 | 2 GIVN XXX 4 | 2 SURN XXXX 5 | 2 SECG XX 6 | 2 NPFX XX. 7 | 1 SEX M 8 | 1 BIRT 9 | 2 DATE 01.01.1970 10 | 2 PLAC XXX,,Vienna,Austria 11 | 2 CHAN 12 | 3 DATE 15 Jun 2013 13 | 4 TIME 16:36:28 14 | 2 CREA 15 | 3 DATE 15 Jun 2013 16 | 4 TIME 10:24:41 17 | 1 CHAN 18 | 2 DATE 16 Jun 2013 19 | 3 TIME 13:55:29 20 | 1 CREA 21 | 2 DATE 16 Jun 2013 22 | 3 TIME 10:24:28 23 | -------------------------------------------------------------------------------- /tests/issue/files/issue00017.ged: -------------------------------------------------------------------------------- 1 | 0 @P1232@ INDI 2 | 1 BIRT 3 | 2 DATE 1 May 1950 4 | 2 PLAC Chicago, Cook, Illinois, United States 5 | 1 NAME John Doe 6 | 1 FAMC 7 | 1 SEX M 8 | -------------------------------------------------------------------------------- /tests/issue/files/issue00018.ged: -------------------------------------------------------------------------------- 1 | 0 @S-1305285410@ SOUR 2 | 1 REPO @R-1553404477@ 3 | 1 TITL Minnesota, Territorial and State Census, 1849-1905 4 | 1 AUTH Ancestry.com 5 | 1 PUBL Online publication - Provo, UT, USA: Ancestry.com Operations Inc, 2007.Original data - Minnesota Historical Society. Minnesota State Population Census Schedules, 1865-1905. St. Paul, MN, USA: Minnesot 6 | 2 CONC a Historical Society, 1977. Microfilm. Reels 1-47 and 10 7 | 1 NOTE 8 | -------------------------------------------------------------------------------- /tests/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | library/Gedcom/ 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/stresstestfiles/TGC551.ged: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cgdsoftware/php-gedcom/d45a8de7b9debe697a67962c2e0ac92a3de782e5/tests/stresstestfiles/TGC551.ged -------------------------------------------------------------------------------- /tests/stresstestfiles/TGC551LF.ged: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cgdsoftware/php-gedcom/d45a8de7b9debe697a67962c2e0ac92a3de782e5/tests/stresstestfiles/TGC551LF.ged -------------------------------------------------------------------------------- /tests/stresstestfiles/TGC55C.ged: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cgdsoftware/php-gedcom/d45a8de7b9debe697a67962c2e0ac92a3de782e5/tests/stresstestfiles/TGC55C.ged -------------------------------------------------------------------------------- /tests/stresstestfiles/TGC55CLF.ged: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cgdsoftware/php-gedcom/d45a8de7b9debe697a67962c2e0ac92a3de782e5/tests/stresstestfiles/TGC55CLF.ged --------------------------------------------------------------------------------