/**
  * Returns the $revision of the entity with the $parentIdentifier
  *
  * notice that the returned Entity may not have the same identifier as $parentIdentifier
  * @return Entity
  */
 protected function hydrateEntityInRevision($parentIdentifier, $revision)
 {
     $parentIdentifier = $this->v->validateIdentifier($parentIdentifier, $this->getEntityMeta());
     if ($revision === $this->defaultRevision) {
         return $this->repository->hydrate($parentIdentifier);
     } else {
         throw EntityNotFoundException::criteria(compact('parentIdentifier', 'revision'));
     }
 }
Esempio n. 2
0
 protected function expectRepositoryHydratesNot($identifier)
 {
     $this->repository->expects($this->once())->method('hydrate')->with($this->equalTo($identifier))->will($this->throwException(\Psc\Doctrine\EntityNotFoundException::criteria(array('identifier' => $identifier))));
 }
 /**
  * Wird der Identifier angegeben schmeisst das Repository eine \Psc\Doctrine\EntityNotFoundException
  * 
  * @return InvocationMockerBuilder
  */
 public function expectDoesNotFind($identifier, $matcher = NULL)
 {
     return $this->buildExpectation('hydrate', $matcher)->with($this->equalTo($identifier))->will($this->throwException(\Psc\Doctrine\EntityNotFoundException::criteria(array('identifier' => $identifier))));
 }