Conditions | 6 |
Paths | 17 |
Total Lines | 40 |
Code Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
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 | } |
||
67 |