/** * @param string $expression * @param callable $filter * @param callable $stopAt * @param int $options * @throws \InvalidArgumentException * @return array */ public function fetch($expression, callable $filter = NULL, callable $stopAt = NULL, $options = 0) { if ($this->validateContextIgnore($expression, $options)) { $nodes = $this->fetchFor($expression, NULL, $filter, $stopAt, $options); } else { $nodes = array(); foreach ($this->_nodes->toArray() as $context) { $nodes = array_merge($nodes, $this->fetchFor($expression, $context, $filter, $stopAt, $options)); } } return $this->unique($nodes, $options); }