Doctrine\ODM\PHPCR\UnitOfWork::contains PHP Method

contains() public method

public contains ( object | string $document ) : boolean
$document object | string document instance or document object hash
return boolean
    public function contains($document)
    {
        $oid = is_object($document) ? spl_object_hash($document) : $document;
        return isset($this->documentIds[$oid]) && !isset($this->scheduledRemovals[$oid]);
    }

Usage Example

Beispiel #1
0
 /**
  * {@inheritDoc}
  *
  * Check if this repository contains the object
  *
  * @param object $document
  *
  * @return boolean true if the repository contains the object, false otherwise
  *
  * @throws InvalidArgumentException if $document is not an object.
  */
 public function contains($document)
 {
     if (!is_object($document)) {
         throw new InvalidArgumentException('Parameter $document needs to be an object, ' . gettype($document) . ' given');
     }
     return $this->unitOfWork->contains($document);
 }
All Usage Examples Of Doctrine\ODM\PHPCR\UnitOfWork::contains
UnitOfWork