private function hasIdentifier($reference)
    {
        // in case if reference is set after flush, store its identity
        $uow = $this->manager->getUnitOfWork();

        if ($this->manager instanceof PhpcrDocumentManager) {
            return $uow->contains($reference);
        } else {
            return $uow->isInIdentityMap($reference);
        }
    }
private function hasIdentifier($reference)
    {
        // in case if reference is set after flush, store its identity
        $uow = $this->manager->getUnitOfWork();

        if ($this->manager instanceof PhpcrDocumentManager) {
            return $uow->contains($reference);
        } else {
            return $uow->isInIdentityMap($reference);
        }
    }
private function hasIdentifier ( $ reference ) { // in case if reference is set after flush, store its identity $ uow = $ this -> manager -> getUnitOfWork ( ) ; if ( $ this -> manager instanceof PhpcrDocumentManager ) { return $ uow -> contains ( $ reference ) ; } else { return $ uow -> isInIdentityMap ( $ reference ) ; } }
Checks if object has identifier already in unit of work.

@param $reference

@return bool
Checks if object has identifier already in unit of work .