Doctrine\ODM\MongoDB\UnitOfWork::isScheduledForUpdate PHP Method

isScheduledForUpdate() public method

Note: Is not very useful currently as dirty documents are only registered at commit time.
public isScheduledForUpdate ( object $document ) : boolean
$document object
return boolean
    public function isScheduledForUpdate($document)
    {
        return isset($this->documentUpdates[spl_object_hash($document)]);
    }

Usage Example

 function it_schedules_owning_document_for_update_when_setting_element_by_key_in_the_collection(MongoDBODMUnitOfWork $uow, DocumentStub $document, ObjectRepository $repository, ClassMetadata $classMetadata, EntityStub $entity4, EntityStub $entity8, EntityStub $entity15, EntityStub $newEntity)
 {
     $classMetadata->getIdentifier()->willReturn(['id']);
     $repository->findBy(['id' => [4, 8, 15]])->willReturn([$entity4, $entity8, $entity15]);
     $uow->getDocumentState($document)->willReturn(MongoDBODMUnitOfWork::STATE_MANAGED);
     $uow->isScheduledForUpdate($document)->willReturn(false);
     $uow->scheduleForUpdate($document)->shouldBeCalled();
     $this->setOwner($document);
     $this->set(2, $newEntity);
 }
All Usage Examples Of Doctrine\ODM\MongoDB\UnitOfWork::isScheduledForUpdate
UnitOfWork