Doctrine\ORM\UnitOfWork::scheduleForUpdate PHP Method

scheduleForUpdate() public method

Schedules an entity for being updated.
public scheduleForUpdate ( object $entity )
$entity object The entity to schedule for being updated.
    public function scheduleForUpdate($entity)
    {
        $oid = spl_object_hash($entity);
        if ( ! isset($this->entityIdentifiers[$oid])) {
            throw new InvalidArgumentException("Entity has no identity.");
        }
        if (isset($this->entityDeletions[$oid])) {
            throw new InvalidArgumentException("Entity is removed.");
        }

        if ( ! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) {
            $this->entityUpdates[$oid] = $entity;
        }
    }