Skip to content

Commit

Permalink
Merge pull request #32 from familytree365/fix/gedcom_import_export
Browse files Browse the repository at this point in the history
Fix add family when export gedcom
  • Loading branch information
curtisdelicata authored Aug 30, 2021
2 parents 698ad91 + 0099602 commit 0c715bd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function __call($method, $args)
}

if (!property_exists($this, '_'.$arr)) {
throw new \Gedcom\Exception('Unknown '.$this::class.'::'.$arr);
throw new \Exception('Unknown '.$this::class.'::'.$arr);
}

return $this->{'_'.$arr};
Expand Down
7 changes: 7 additions & 0 deletions src/Record/SourRef.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,11 @@ class SourRef extends \Gedcom\Record

protected $_obje = [];
protected $_note = [];

public function setSour($sour = '')
{
$this->_sour = $sour;

return $this;
}
}
2 changes: 1 addition & 1 deletion src/Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static function convert(Gedcom $gedcom, $format = self::GEDCOM55)
if (!empty($sours) && count($sours) > 0) {
foreach ($sours as $item) {
if ($item) {
$output .= Sour::convert($item);
$output .= Sour::convert($item, 0);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Writer/Indi.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,21 @@ public static function convert(\Gedcom\Record\Indi &$indi)
}

// $birthday
$birthday = $indi->getBirthday();
$birthday = $indi->getBirt();
if (!empty($birthday)) {
$output .= $level.' BIRT '."\n";
$output .= ($level+1).' DATE '.$birthday."\n";
}

// $deathday
$deathday = $indi->getDeathday();
$deathday = $indi->getDeat();
if (!empty($deathday)) {
$output .= $level.' DEAT '."\n";
$output .= ($level+1).' DATE '.$deathday."\n";
}

// $burialday
$burialday = $indi->getBurialday();
$burialday = $indi->getBuri();
if (!empty($burialday)) {
$output .= $level.' BURI '."\n";
$output .= ($level+1).' DATE '.$burialday."\n";
Expand Down

0 comments on commit 0c715bd

Please sign in to comment.