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

propertyChanged() public method

Notifies this UnitOfWork of a property change in a document.
public propertyChanged ( object $document, string $propertyName, mixed $oldValue, mixed $newValue )
$document object The document that owns the property.
$propertyName string The name of the property that changed.
$oldValue mixed The old value of the property.
$newValue mixed The new value of the property.
    public function propertyChanged($document, $propertyName, $oldValue, $newValue)
    {
        $oid = spl_object_hash($document);
        $class = $this->dm->getClassMetadata(get_class($document));
        if (!isset($class->fieldMappings[$propertyName])) {
            return;
            // ignore non-persistent fields
        }
        // Update changeset and mark document for synchronization
        $this->documentChangeSets[$oid][$propertyName] = array($oldValue, $newValue);
        if (!isset($this->scheduledForDirtyCheck[$class->name][$oid])) {
            $this->scheduleForDirtyCheck($document);
        }
    }
UnitOfWork