1 | <?php |
||
15 | class LaravelReadQuery |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * Gets collection of entities belongs to an entity set |
||
20 | * IE: http://host/EntitySet |
||
21 | * http://host/EntitySet?$skip=10&$top=5&filter=Prop gt Value |
||
22 | * |
||
23 | * @param QueryType $queryType indicates if this is a query for a count, entities, or entities with a count |
||
24 | * @param ResourceSet $resourceSet The entity set containing the entities to fetch |
||
25 | * @param FilterInfo $filterInfo represents the $filter parameter of the OData query. NULL if no $filter specified |
||
26 | * @param mixed $orderBy sorted order if we want to get the data in some specific order |
||
27 | * @param int $top number of records which need to be skip |
||
28 | * @param String $skipToken value indicating what records to skip |
||
29 | * |
||
30 | * @return QueryResult |
||
31 | */ |
||
32 | public function getResourceSet( |
||
94 | |||
95 | /** |
||
96 | * Get related resource set for a resource |
||
97 | * IE: http://host/EntitySet(1L)/NavigationPropertyToCollection |
||
98 | * http://host/EntitySet?$expand=NavigationPropertyToCollection |
||
99 | * |
||
100 | * @param QueryType $queryType indicates if this is a query for a count, entities, or entities with a count |
||
101 | * @param ResourceSet $sourceResourceSet The entity set containing the source entity |
||
102 | * @param object $sourceEntityInstance The source entity instance. |
||
103 | * @param ResourceSet $targetResourceSet The resource set of containing the target of the navigation property |
||
104 | * @param ResourceProperty $targetProperty The navigation property to retrieve |
||
105 | * @param FilterInfo $filter represents the $filter parameter of the OData query. NULL if no $filter specified |
||
106 | * @param mixed $orderBy sorted order if we want to get the data in some specific order |
||
107 | * @param int $top number of records which need to be skip |
||
108 | * @param String $skip value indicating what records to skip |
||
109 | * |
||
110 | * @return QueryResult |
||
111 | * |
||
112 | */ |
||
113 | public function getRelatedResourceSet( |
||
143 | |||
144 | /** |
||
145 | * Gets an entity instance from an entity set identified by a key |
||
146 | * IE: http://host/EntitySet(1L) |
||
147 | * http://host/EntitySet(KeyA=2L,KeyB='someValue') |
||
148 | * |
||
149 | * @param ResourceSet $resourceSet The entity set containing the entity to fetch |
||
150 | * @param KeyDescriptor $keyDescriptor The key identifying the entity to fetch |
||
151 | * |
||
152 | * @return object|null Returns entity instance if found else null |
||
153 | */ |
||
154 | public function getResourceFromResourceSet( |
||
160 | |||
161 | |||
162 | /** |
||
163 | * Common method for getResourceFromRelatedResourceSet() and getResourceFromResourceSet() |
||
164 | * @param ResourceSet|null $resourceSet |
||
165 | * @param KeyDescriptor|null $keyDescriptor |
||
166 | */ |
||
167 | public function getResource( |
||
194 | |||
195 | /** |
||
196 | * Get related resource for a resource |
||
197 | * IE: http://host/EntitySet(1L)/NavigationPropertyToSingleEntity |
||
198 | * http://host/EntitySet?$expand=NavigationPropertyToSingleEntity |
||
199 | * |
||
200 | * @param ResourceSet $sourceResourceSet The entity set containing the source entity |
||
201 | * @param object $sourceEntityInstance The source entity instance. |
||
202 | * @param ResourceSet $targetResourceSet The entity set containing the entity pointed to by the navigation property |
||
203 | * @param ResourceProperty $targetProperty The navigation property to fetch |
||
204 | * |
||
205 | * @return object|null The related resource if found else null |
||
206 | */ |
||
207 | public function getRelatedResourceReference( |
||
219 | |||
220 | /** |
||
221 | * Gets a related entity instance from an entity set identified by a key |
||
222 | * IE: http://host/EntitySet(1L)/NavigationPropertyToCollection(33) |
||
223 | * |
||
224 | * @param ResourceSet $sourceResourceSet The entity set containing the source entity |
||
225 | * @param object $sourceEntityInstance The source entity instance. |
||
226 | * @param ResourceSet $targetResourceSet The entity set containing the entity to fetch |
||
227 | * @param ResourceProperty $targetProperty The metadata of the target property. |
||
228 | * @param KeyDescriptor $keyDescriptor The key identifying the entity to fetch |
||
229 | * |
||
230 | * @return object|null Returns entity instance if found else null |
||
231 | */ |
||
232 | public function getResourceFromRelatedResourceSet( |
||
245 | |||
246 | |||
247 | /** |
||
248 | * @param ResourceSet $resourceSet |
||
249 | * @return mixed |
||
250 | */ |
||
251 | protected function getSourceEntityInstance(ResourceSet $resourceSet) |
||
256 | } |
||
257 |
create_function
can pose a great security vulnerability as it is similar toeval
, and could be used for arbitrary code execution. We highly recommend to use a closure instead.