1 | <?php |
||
18 | class Pathfinder |
||
19 | { |
||
20 | /** |
||
21 | * Combines the query and an object to retrieve a list of nodes that are to be used as node-point in a template. |
||
22 | * |
||
23 | * This method interprets the provided query string and walks through the given object to find the correct |
||
24 | * element. This method will silently fail if an invalid query was provided; in such a case the given object |
||
25 | * is returned. |
||
26 | * |
||
27 | * @param object $object |
||
28 | * @param string $query |
||
29 | * |
||
30 | * @return \Traversable|array |
||
31 | */ |
||
32 | public function find($object, $query) |
||
46 | |||
47 | /** |
||
48 | * Walks an object graph and/or array using a twig query string. |
||
49 | * |
||
50 | * @param \Traversable|mixed $objectOrArray |
||
51 | * @param string $query A path to walk separated by dots, i.e. `namespace.namespaces`. |
||
52 | * |
||
53 | * @return mixed |
||
54 | */ |
||
55 | private function walkObjectTree($objectOrArray, $query) |
||
90 | } |
||
91 |