| Conditions | 3 |
| Paths | 8 |
| Total Lines | 16 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 2 | public function loadMultiple(ARecord $record): array |
|
| 27 | { |
||
| 28 | 2 | $inPath = $this->getPathFromPk($record); |
|
| 29 | 2 | $path = strval($record->offsetGet($inPath)); |
|
| 30 | 2 | $records = []; |
|
| 31 | try { |
||
| 32 | 2 | foreach ($this->getStorage()->lookup($path) as $contentKey) { |
|
| 33 | 1 | $rec = clone $record; |
|
| 34 | 1 | $rec->offsetSet($inPath, $path . $contentKey); |
|
| 35 | 1 | $rec->load(); |
|
| 36 | 1 | $records[] = $rec; |
|
| 37 | } |
||
| 38 | 1 | } catch (StorageException $ex) { |
|
| 39 | 1 | return []; |
|
| 40 | } |
||
| 41 | 1 | return $records; |
|
| 42 | } |
||
| 44 |