/** * 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); }
/** * 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; }