| Conditions | 9 |
| Paths | 9 |
| Total Lines | 36 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public static function convert(\PhpGedcom\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 = \PhpGedcom\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 = \PhpGedcom\Writer\NoteRef::convert($item, $level); |
||
| 56 | $output .= $_convert; |
||
| 57 | } |
||
| 58 | } |
||
| 59 | |||
| 60 | return $output; |
||
| 61 | } |
||
| 63 |