/**
  * Fetch the entity
  *
  * @return  object
  *
  * @throws  EntityNotFoundException  if the specified entity does not exist.
  */
 public function getItem()
 {
     $entities = parent::getItems();
     if (empty($entities)) {
         throw new EntityNotFoundException();
     }
     return reset($entities);
 }
Ejemplo n.º 2
0
 /**
  * Find multiple entities.
  *
  * @return  CollectionFinderInterface  The responsible Finder object
  *
  * @throws  OrmException  if there was an error getting the entities
  */
 public function findAll()
 {
     $finder = new DoctrineCollectionFinder($this->connection, $this->table, $this->entityClass, $this->entityRegistry);
     $finder->setDispatcher($this->getDispatcher());
     return $finder;
 }