public getObjectByIdentifier ( mixed $identifier, string $objectType = null, boolean $useLazyLoading = false ) : object | ||
$identifier | mixed | |
$objectType | string | |
$useLazyLoading | boolean | Set to TRUE if you want to use lazy loading for this object |
return | object | The object for the identifier if it is known, or NULL |
public function getObjectByIdentifier($identifier, $objectType = null, $useLazyLoading = false);
/** * Loads the objects this LazySplObjectStorage is supposed to hold. * * @return void */ protected function initialize() { if (is_array($this->objectIdentifiers)) { foreach ($this->objectIdentifiers as $identifier) { try { parent::attach($this->persistenceManager->getObjectByIdentifier($identifier)); } catch (Exception\InvalidObjectDataException $exception) { // when security query rewriting holds back an object here, we skip it... } } $this->objectIdentifiers = null; } }