Newscoop\Entity\Repository\TemplateRepository::flush PHP Method

flush() public method

public flush ( )
    public function flush()
    {
        return $this->getEntityManager()->flush();
    }

Usage Example

Ejemplo n.º 1
0
 /**
  *
  */
 public function cacheTemplates($path)
 {
     try {
         $items = array();
         foreach ($this->storage->listItems($path) as $file) {
             $storageFile = $this->storage->getItem($file);
             if (!$storageFile->isDir() && $storageFile->getType() == 'tpl') {
                 $items[] = $this->repository->getTemplate($storageFile);
             }
         }
         return $this->repository->flush();
     } catch (\InvalidArgumentException $e) {
         throw new \InvalidArgumentException(sprintf("'%s' not found", $path), $e->getCode(), $e);
     }
 }