public function find($object, $query)
    {
        if ($query) {
            $node = $this->walkObjectTree($object, $query);

            if (!is_array($node) && (!$node instanceof \Traversable)) {
                $node = [$node];
            }

            return $node;
        }

        return [$object];
    }
public function find($object, $query)
    {
        if ($query) {
            $node = $this->walkObjectTree($object, $query);

            if (!is_array($node) && (!$node instanceof \Traversable)) {
                $node = [$node];
            }

            return $node;
        }

        return [$object];
    }
public function find ( $ object , $ query ) { if ( $ query ) { $ node = $ this -> walkObjectTree ( $ object , $ query ) ; if ( ! is_array ( $ node ) && ( ! $ node instanceof \ Traversable ) ) { $ node = [ $ node ] ; } return $ node ; } return [ $ object ] ; }
Combines the query and an object to retrieve a list of nodes that are to be used as node-point in a template.

This method interprets the provided query string and walks through the given object to find the correct
element. This method will silently fail if an invalid query was provided; in such a case the given object
is returned.

@param object $object
@param string $query

@return \Traversable|array
Combines the query and an object to retrieve a list of nodes that are to be used as node - point in a template .