Doctrine\ODM\MongoDB\Persisters\DocumentPersister::exists PHP Метод

exists() публичный Метод

Checks whether the given managed document exists in the database.
public exists ( object $document ) : boolean
$document object
Результат boolean TRUE if the document exists in the database, FALSE otherwise.
    public function exists($document)
    {
        $id = $this->class->getIdentifierObject($document);
        return (bool) $this->collection->findOne(array(array('_id' => $id)), array('_id'));
    }