1 | <?php |
||
15 | trait IdentifierCollectionContainer |
||
16 | { |
||
17 | /** |
||
18 | * Resource identifiers |
||
19 | * |
||
20 | * @var ResourceIdentifierObject[] |
||
21 | */ |
||
22 | protected $identifiers = []; |
||
23 | |||
24 | /** |
||
25 | * Add resource identifier |
||
26 | * |
||
27 | * @param ResourceIdentifierObject $identifier |
||
28 | */ |
||
29 | 9 | public function addIdentifier(ResourceIdentifierObject $identifier) |
|
33 | |||
34 | /** |
||
35 | * Get first identifier from collection |
||
36 | * |
||
37 | * @return ResourceIdentifierObject |
||
38 | */ |
||
39 | 2 | public function getFirstIdentifier(): ResourceIdentifierObject |
|
43 | |||
44 | /** |
||
45 | * Contains any identifiers |
||
46 | * |
||
47 | * @return bool |
||
48 | */ |
||
49 | public function hasIdentifiers(): bool |
||
53 | |||
54 | /** |
||
55 | * Get resource identifiers |
||
56 | * |
||
57 | * @return ResourceIdentifierObject[] |
||
58 | */ |
||
59 | 16 | public function getIdentifiers(): array |
|
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | 2 | public function getIterator(): \Traversable |
|
71 | |||
72 | /** |
||
73 | * Cast identifiers to an array |
||
74 | * |
||
75 | * @return array |
||
76 | */ |
||
77 | 9 | protected function identifiersToArray(): array |
|
88 | } |