find() public method

Finds a document matching the specified identifier. Optionally a lock mode and expected version may be specified.
public find ( mixed $id, integer $lockMode = LockMode::NONE, integer $lockVersion = null ) : object | null
$id mixed Identifier.
$lockMode integer Optional. Lock mode; one of the LockMode constants.
$lockVersion integer Optional. Expected version.
return object | null The document, if found, otherwise null.
Exemplo n.º 1
0
 /**
  * @param Projection $projection
  */
 public function remove(Projection $projection)
 {
     $storedProjection = $this->repository->find($projection->getProjectionName() . '_' . $projection->getAggregateId());
     if (!empty($storedProjection)) {
         $this->manager->remove($storedProjection);
     }
 }
Exemplo n.º 2
0
 public function find($id)
 {
     $calendar = $this->repo->find($id);
     if (null === $calendar) {
         throw new NotFoundHttpException(sprintf("Couldn't find calendar with id '%d'", $id));
     }
     return $calendar;
 }
Exemplo n.º 3
0
 public function find($id)
 {
     $event = $this->repo->find($id);
     if (null === $event) {
         throw new NotFoundHttpException(sprintf("Couldn't find event with id '%d'", $id));
     }
     return $event;
 }
Exemplo n.º 4
0
 /**
  * @param object|string $id
  * @return object
  */
 public function find($id)
 {
     return $this->repository->find($id);
 }
Exemplo n.º 5
0
 /**
  * @param string $documentId id of entity to find
  *
  * @return Object
  */
 public function find($documentId)
 {
     return $this->repository->find($documentId);
 }
Exemplo n.º 6
0
 /**
  * {@inheritdoc}
  */
 public function get(IdInterface $id)
 {
     return $this->repository->find($id->toNative());
 }
Exemplo n.º 7
0
 /**
  * @param Identity $identity
  *
  * @return AggregateRoot
  */
 public function get(Identity $identity)
 {
     return $this->documentRepository->find($identity);
 }
Exemplo n.º 8
0
 /**
  * Finds one Url by location, returns null if not found
  *
  * @param string $loc
  * @return OpenSky\Bundle\SitemapBundle\Sitemap\Url|null
  */
 public function findOne($loc)
 {
     return $this->repository->find($loc);
 }