1 | <?php |
||
22 | class QueryResult implements QueryResultInterface |
||
23 | { |
||
24 | /** |
||
25 | * @var PropertyDataInterface[] |
||
26 | */ |
||
27 | protected $propertiesById = array(); |
||
28 | |||
29 | /** |
||
30 | * @var PropertyDataInterface[] |
||
31 | */ |
||
32 | protected $propertiesByQueryName = array(); |
||
33 | |||
34 | /** |
||
35 | * @var AllowableActionsInterface|null |
||
36 | */ |
||
37 | protected $allowableActions = null; |
||
38 | |||
39 | /** |
||
40 | * @var RelationshipInterface[] |
||
41 | */ |
||
42 | protected $relationships = array(); |
||
43 | |||
44 | /** |
||
45 | * @var RenditionInterface[] |
||
46 | */ |
||
47 | protected $renditions = array(); |
||
48 | |||
49 | /** |
||
50 | * @param SessionInterface $session |
||
51 | * @param ObjectDataInterface $objectData |
||
52 | */ |
||
53 | 16 | public function __construct(SessionInterface $session, ObjectDataInterface $objectData) |
|
96 | |||
97 | /** |
||
98 | * Returns the allowable actions if they have been requested. |
||
99 | * |
||
100 | * @return AllowableActionsInterface|null the allowable actions if they have been requested, <code>null</code> |
||
101 | * otherwise |
||
102 | */ |
||
103 | 1 | public function getAllowableActions() |
|
107 | |||
108 | /** |
||
109 | * Returns the list of all properties in this query result. |
||
110 | * |
||
111 | * @return PropertyDataInterface[] all properties, not <code>null</code> |
||
112 | */ |
||
113 | 1 | public function getProperties() |
|
117 | |||
118 | /** |
||
119 | * Returns a property by ID. |
||
120 | * |
||
121 | * Because repositories are not obligated to add property IDs to their query result properties, |
||
122 | * this method might not always work as expected with some repositories. Use getPropertyByQueryName(String) instead. |
||
123 | * |
||
124 | * @param string $id |
||
125 | * @return PropertyDataInterface|null the property or <code>null</code> if the property doesn't |
||
126 | * exist or hasn't been requested |
||
127 | */ |
||
128 | 3 | public function getPropertyById($id) |
|
132 | |||
133 | /** |
||
134 | * Returns a property by query name or alias. |
||
135 | * |
||
136 | * @param string $queryName the property query name or alias |
||
137 | * @return PropertyDataInterface|null the property or <code>null</code> if the property doesn't exist |
||
138 | * or hasn't been requested |
||
139 | */ |
||
140 | 3 | public function getPropertyByQueryName($queryName) |
|
144 | |||
145 | /** |
||
146 | * Returns a property multi-value by ID. |
||
147 | * |
||
148 | * @param string $id the property ID |
||
149 | * @return array|null the property value or <code>null</code> if the property doesn't exist, hasn't been requested, |
||
150 | * or the property value isn't set |
||
151 | */ |
||
152 | 1 | public function getPropertyMultivalueById($id) |
|
158 | |||
159 | /** |
||
160 | * Returns a property multi-value by query name or alias. |
||
161 | * |
||
162 | * @param string $queryName the property query name or alias |
||
163 | * @return array|null the property value or <code>null</code> if the property doesn't exist, hasn't been requested, |
||
164 | * or the property value isn't set |
||
165 | */ |
||
166 | 1 | public function getPropertyMultivalueByQueryName($queryName) |
|
172 | |||
173 | /** |
||
174 | * Returns a property (single) value by ID. |
||
175 | * |
||
176 | * @param string $id the property ID |
||
177 | * @return mixed |
||
178 | */ |
||
179 | 1 | public function getPropertyValueById($id) |
|
185 | |||
186 | /** |
||
187 | * Returns a property (single) value by query name or alias. |
||
188 | * |
||
189 | * @param string $queryName the property query name or alias |
||
190 | * @return mixed the property value or <code>null</code> if the property doesn't exist, hasn't been requested, |
||
191 | * or the property value isn't set |
||
192 | */ |
||
193 | 1 | public function getPropertyValueByQueryName($queryName) |
|
199 | |||
200 | /** |
||
201 | * Returns the relationships if they have been requested. |
||
202 | * |
||
203 | * @return RelationshipInterface[] |
||
204 | */ |
||
205 | 1 | public function getRelationships() |
|
209 | |||
210 | /** |
||
211 | * Returns the renditions if they have been requested. |
||
212 | * |
||
213 | * @return RenditionInterface[] |
||
214 | */ |
||
215 | 1 | public function getRenditions() |
|
219 | } |
||
220 |