Neos\Flow\Persistence\Generic\Session::hasIdentifier PHP Method

hasIdentifier() public method

Checks whether the given identifier is known to the identity map
public hasIdentifier ( string $identifier ) : boolean
$identifier string
return boolean
    public function hasIdentifier($identifier)
    {
        return array_key_exists($identifier, $this->identifierMap);
    }

Usage Example

Example #1
0
 /**
  * Returns the object with the (internal) identifier, if it is known to the
  * backend. Otherwise NULL is returned.
  *
  * @param mixed $identifier
  * @param string $objectType
  * @param boolean $useLazyLoading This option is ignored in this persistence manager
  * @return object The object for the identifier if it is known, or NULL
  * @api
  */
 public function getObjectByIdentifier($identifier, $objectType = null, $useLazyLoading = false)
 {
     if (isset($this->newObjects[$identifier])) {
         return $this->newObjects[$identifier];
     }
     if ($this->persistenceSession->hasIdentifier($identifier)) {
         return $this->persistenceSession->getObjectByIdentifier($identifier);
     } else {
         $objectData = $this->backend->getObjectDataByIdentifier($identifier, $objectType);
         if ($objectData !== false) {
             return $this->dataMapper->mapToObject($objectData);
         } else {
             return null;
         }
     }
 }
All Usage Examples Of Neos\Flow\Persistence\Generic\Session::hasIdentifier