Inheritance: extends Doctrine\ORM\EntityRepository
Esempio n. 1
0
 /**
  * Rename item
  *
  * @param string $src
  * @param string $dest
  * @return void
  * @throws InvalidArgumentException
  */
 public function renameItem($src, $dest)
 {
     try {
         $name = basename($dest);
         $dest = ltrim(dirname($src) . $name, './');
         $this->storage->renameItem($src, $name);
         $this->repository->updateKey($src, $dest);
     } catch (\InvalidArgumentException $e) {
         throw new \InvalidArgumentException(sprintf('The template object %s could not be renamed.', basename($src)), $e->getCode(), $e);
     }
 }
Esempio n. 2
0
 /**
  * Implements Iterator::current
  *
  * @return Newscoop\Entity\Template
  */
 public function current()
 {
     $file = new \SplFileObject(current($this->files));
     return $this->repository->getTemplate($file, $this->root);
 }