Doctrine\OXM\UnitOfWork::propertyChanged PHP Method

propertyChanged() public method

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