public isNewObject ( object $object ) : boolean | ||
$object | object | The object to check |
return | boolean | TRUE if the object is new, FALSE if the object exists in the repository |
public function isNewObject($object)
{
return $this->entityManager->getUnitOfWork()->getEntityState($object, \Doctrine\ORM\UnitOfWork::STATE_NEW) === \Doctrine\ORM\UnitOfWork::STATE_NEW;
}