/** * @see PropertyLookup::getPropertyForId */ public function getPropertyForId(PropertyId $propertyId) { try { return $this->entityDocumentLookup->getEntityDocumentForId($propertyId); } catch (EntityNotFoundException $e) { throw new PropertyNotFoundException($e->getEntityId()); } }
/** * @see EntityDocumentLookup::getEntityDocumentForId */ public function getEntityDocumentForId(EntityId $entityId) { try { return $this->entityCache->fetch($entityId); } catch (EntityNotFoundException $e) { $entity = $this->entityLookup->getEntityDocumentForId($entityId); $this->entityCache->save($entity); return $entity; } }
/** * @see EntityDocumentLookup::getEntityDocumentForId */ public function getEntityDocumentForId(EntityId $entityId) { $entity = $this->entityCache->fetch($entityId); if ($entity === null) { $entity = $this->entityLookup->getEntityDocumentForId($entityId); if ($entity !== null) { $this->entityCache->save($entity); } } return $entity; }