public function isNewObject($object)
    {
        return ($this->entityManager->getUnitOfWork()->getEntityState($object, \Doctrine\ORM\UnitOfWork::STATE_NEW) === \Doctrine\ORM\UnitOfWork::STATE_NEW);
    }
public function isNewObject($object)
    {
        return ($this->entityManager->getUnitOfWork()->getEntityState($object, \Doctrine\ORM\UnitOfWork::STATE_NEW) === \Doctrine\ORM\UnitOfWork::STATE_NEW);
    }
public function isNewObject ( $ object ) { return ( $ this -> entityManager -> getUnitOfWork ( ) -> getEntityState ( $ object , \ Doctrine \ ORM \ UnitOfWork :: STATE_NEW ) === \ Doctrine \ ORM \ UnitOfWork :: STATE_NEW ) ; }
Checks if the given object has ever been persisted.

@param object $object The object to check
@return boolean true if the object is new, false if the object exists in the repository
@api
Checks if the given object has ever been persisted .