1 | <?php |
||
20 | abstract class AbstractMetadata extends MetadataContainerAbstract |
||
21 | { |
||
22 | use FinderTrait; |
||
23 | |||
24 | 5 | protected function cutMetadata($raw) |
|
25 | { |
||
26 | 5 | if (empty($raw) || !is_array($raw)) { |
|
27 | 1 | return [[]]; |
|
28 | } |
||
29 | |||
30 | 4 | if (array_key_exists('_links', $raw)) { |
|
31 | 1 | foreach ($raw['_links'] as $k => $v) { |
|
32 | 1 | $raw['links'][] = [ |
|
33 | 1 | 'rel' => $k, |
|
34 | 1 | 'href' => current($v), |
|
35 | ]; |
||
36 | } |
||
37 | } |
||
38 | |||
39 | 4 | return $this->dataPiece('links', $raw); |
|
40 | } |
||
41 | |||
42 | 4 | protected function normalizeMetas($metas) |
|
60 | } |
||
61 |