Conditions | 9 |
Paths | 9 |
Total Lines | 31 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
14 | public static function read($conn, \Gedcom\Record\RepoRef $reporef, $group = '', $group_id = 0) |
||
15 | { |
||
16 | if ($reporef == null) { |
||
17 | return; |
||
18 | } |
||
19 | $repo = $reporef->getRepo(); |
||
20 | // store Source |
||
21 | $key = ['group'=>$group, 'gid'=>$group_id, 'repo' => $repo]; |
||
22 | $data = [ |
||
23 | 'group'=> $group, |
||
24 | 'gid' => $group_id, |
||
25 | 'repo' => $repo, |
||
26 | ]; |
||
27 | $record = Repository::on($conn)->updateOrCreate($key, $data); |
||
28 | |||
29 | $_group = 'reporef'; |
||
30 | $_gid = $record->id; |
||
31 | // store Note |
||
32 | $notes = $reporef->getNote(); |
||
33 | if ($notes && count($notes) > 0) { |
||
|
|||
34 | foreach ($notes as $item) { |
||
35 | NoteRef::read($conn, $item, $_group, $_gid); |
||
36 | } |
||
37 | } |
||
38 | |||
39 | // store Caln |
||
40 | $caln = $reporef->getCaln(); |
||
41 | if ($caln && count($caln) > 0) { |
||
42 | foreach ($caln as $item) { |
||
43 | if ($item) { |
||
44 | Caln::read($conn, $item, $_group, $_gid); |
||
45 | } |
||
50 |