public function hasUnpersistedChanges()
    {
        $unitOfWork = $this->entityManager->getUnitOfWork();
        $unitOfWork->computeChangeSets();

        if ($unitOfWork->getScheduledEntityInsertions() !== []
            || $unitOfWork->getScheduledEntityUpdates() !== []
            || $unitOfWork->getScheduledEntityDeletions() !== []
            || $unitOfWork->getScheduledCollectionDeletions() !== []
            || $unitOfWork->getScheduledCollectionUpdates() !== []
        ) {
            return true;
        }

        return false;
    }
public function hasUnpersistedChanges()
    {
        $unitOfWork = $this->entityManager->getUnitOfWork();
        $unitOfWork->computeChangeSets();

        if ($unitOfWork->getScheduledEntityInsertions() !== []
            || $unitOfWork->getScheduledEntityUpdates() !== []
            || $unitOfWork->getScheduledEntityDeletions() !== []
            || $unitOfWork->getScheduledCollectionDeletions() !== []
            || $unitOfWork->getScheduledCollectionUpdates() !== []
        ) {
            return true;
        }

        return false;
    }
public function hasUnpersistedChanges ( ) { $ unitOfWork = $ this -> entityManager -> getUnitOfWork ( ) ; $ unitOfWork -> computeChangeSets ( ) ; if ( $ unitOfWork -> getScheduledEntityInsertions ( ) !== [ ] || $ unitOfWork -> getScheduledEntityUpdates ( ) !== [ ] || $ unitOfWork -> getScheduledEntityDeletions ( ) !== [ ] || $ unitOfWork -> getScheduledCollectionDeletions ( ) !== [ ] || $ unitOfWork -> getScheduledCollectionUpdates ( ) !== [ ] ) { return true ; } return false ; }
Gives feedback if the persistence Manager has unpersisted changes.

This is primarily used to inform the user if he tries to save
data in an unsafe request.

@return boolean
Gives feedback if the persistence Manager has unpersisted changes .