Skip to content

Commit 0c715bd

Browse files
Merge pull request #32 from familytree365/fix/gedcom_import_export
Fix add family when export gedcom
2 parents 698ad91 + 0099602 commit 0c715bd

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

src/Record.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function __call($method, $args)
7777
}
7878

7979
if (!property_exists($this, '_'.$arr)) {
80-
throw new \Gedcom\Exception('Unknown '.$this::class.'::'.$arr);
80+
throw new \Exception('Unknown '.$this::class.'::'.$arr);
8181
}
8282

8383
return $this->{'_'.$arr};

src/Record/SourRef.php

+7
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,11 @@ class SourRef extends \Gedcom\Record
2727

2828
protected $_obje = [];
2929
protected $_note = [];
30+
31+
public function setSour($sour = '')
32+
{
33+
$this->_sour = $sour;
34+
35+
return $this;
36+
}
3037
}

src/Writer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static function convert(Gedcom $gedcom, $format = self::GEDCOM55)
7373
if (!empty($sours) && count($sours) > 0) {
7474
foreach ($sours as $item) {
7575
if ($item) {
76-
$output .= Sour::convert($item);
76+
$output .= Sour::convert($item, 0);
7777
}
7878
}
7979
}

src/Writer/Indi.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,21 @@ public static function convert(\Gedcom\Record\Indi &$indi)
116116
}
117117

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

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

132132
// $burialday
133-
$burialday = $indi->getBurialday();
133+
$burialday = $indi->getBuri();
134134
if (!empty($burialday)) {
135135
$output .= $level.' BURI '."\n";
136136
$output .= ($level+1).' DATE '.$burialday."\n";

0 commit comments

Comments
 (0)