Neos\Flow\Persistence\PersistenceManagerInterface::getObjectByIdentifier PHP Method

getObjectByIdentifier() public method

Returns the object with the (internal) identifier, if it is known to the backend. Otherwise NULL is returned.
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);

Usage Example

 /**
  * 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;
     }
 }
All Usage Examples Of Neos\Flow\Persistence\PersistenceManagerInterface::getObjectByIdentifier