/** * {@inheritdoc} */ public function find($query, $language = 'glob') { if ($language != 'glob') { throw new UnsupportedLanguageException($language); } $nodes = $this->finder->find($this->resolvePath($query)); return $this->buildCollection($nodes); }
/** * {@inheritdoc} */ public function move($query, $targetPath, $language = 'glob') { $this->failUnlessGlob($language); $nodes = $this->finder->find($this->resolvePath($query)); if (0 === count($nodes)) { return 0; } $targetPath = $this->resolvePath($targetPath); try { // delegate moving to the implementation $this->moveNodes($nodes, $query, $targetPath); } catch (\Exception $e) { throw new \RuntimeException(sprintf('Error encountered when moving resource(s) using query "%s"', $query), null, $e); } return count($nodes); }