Doctrine\ORM\UnitOfWork::scheduleExtraUpdate PHP Method

scheduleExtraUpdate() public method

Extra updates for entities are stored as (entity, changeset) tuples.
public scheduleExtraUpdate ( object $entity, array $changeset )
$entity object The entity for which to schedule an extra update.
$changeset array The changeset of the entity (what to update).
    public function scheduleExtraUpdate($entity, array $changeset)
    {
        $oid = spl_object_hash($entity);
        if (isset($this->extraUpdates[$oid])) {
            list($ignored, $changeset2) = $this->extraUpdates[$oid];
            $this->extraUpdates[$oid] = array($entity, $changeset + $changeset2);
        } else {
            $this->extraUpdates[$oid] = array($entity, $changeset);
        }
    }

Usage Example

 /**
  * Updates modification date for a source.
  *
  * @param SourceInterface $source
  * @param UnitOfWork      $uow
  */
 protected function setSourceModificationDate(SourceInterface $source, UnitOfWork $uow)
 {
     $uow->scheduleExtraUpdate($source, ['datetimeModified' => [0 => $source->getDatetimeModified(), 1 => new \DateTime()]]);
 }
All Usage Examples Of Doctrine\ORM\UnitOfWork::scheduleExtraUpdate