| Conditions | 9 |
| Paths | 8 |
| Total Lines | 29 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public static function read($conn, \Gedcom\Record\Indi\Asso $asso, $group = '', $group_id = 0) |
||
| 15 | { |
||
| 16 | $indi = $group_id; |
||
|
|
|||
| 17 | $_indi = $asso->getIndi(); |
||
| 18 | $rela = $asso->getRela(); |
||
| 19 | |||
| 20 | // store asso |
||
| 21 | $key = ['group'=>$group, 'gid'=>$group_id, 'rela'=>$rela, 'indi' => $_indi]; |
||
| 22 | $data = ['group'=>$group, 'gid'=>$group_id, 'rela'=>$rela, 'indi' => $_indi]; |
||
| 23 | $record = PersonAsso::on($conn)->updateOrCreate($key, $data); |
||
| 24 | |||
| 25 | $_group = 'indi_asso'; |
||
| 26 | $_gid = $record->id; |
||
| 27 | // store Note |
||
| 28 | $note = $asso->getNote(); |
||
| 29 | if ($note && count($note) > 0) { |
||
| 30 | foreach ($note as $item) { |
||
| 31 | if ($item) { |
||
| 32 | \FamilyTree365\LaravelGedcom\Utils\Importer\NoteRef::read($conn, $item, $_group, $_gid); |
||
| 33 | } |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 37 | // store sourref |
||
| 38 | $sour = $asso->getSour(); |
||
| 39 | if ($sour && count($sour) > 0) { |
||
| 40 | foreach ($sour as $item) { |
||
| 41 | if ($item) { |
||
| 42 | \FamilyTree365\LaravelGedcom\Utils\Importer\SourRef::read($conn, $item, $_group, $_gid); |
||
| 43 | } |
||
| 48 |