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.
 /**
  * @param Projection $projection
  */
 public function remove(Projection $projection)
 {
     $storedProjection = $this->repository->find($projection->getProjectionName() . '_' . $projection->getAggregateId());
     if (!empty($storedProjection)) {
         $this->manager->remove($storedProjection);
     }
 }
 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;
 }
Beispiel #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;
 }
 /**
  * @param object|string $id
  * @return object
  */
 public function find($id)
 {
     return $this->repository->find($id);
 }
Beispiel #5
0
 /**
  * @param string $documentId id of entity to find
  *
  * @return Object
  */
 public function find($documentId)
 {
     return $this->repository->find($documentId);
 }
Beispiel #6
0
 /**
  * {@inheritdoc}
  */
 public function get(IdInterface $id)
 {
     return $this->repository->find($id->toNative());
 }
 /**
  * @param Identity $identity
  *
  * @return AggregateRoot
  */
 public function get(Identity $identity)
 {
     return $this->documentRepository->find($identity);
 }
Beispiel #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);
 }