Schedules an entity for being updated.

@param object $entity The entity to schedule for being updated.

@throws ORMInvalidArgumentException
777144
public function scheduleForUpdate($entity) : void
    {
        $oid = spl_object_id($entity);

        if (! isset($this->entityIdentifiers[$oid])) {
            throw ORMInvalidArgumentException::entityHasNoIdentity($entity, 'scheduling for update');
        }

        if (isset($this->entityDeletions[$oid])) {
            throw ORMInvalidArgumentException::entityIsRemoved($entity, 'schedule for update');
        }

        if (! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) {
            $this->entityUpdates[$oid] = $entity;
        }
    }
995680
public function add($entity)
    {
        foreach ($this->restrictions as $preset) {
            if ($preset['op'] == Operator::EQUAL) {
                $property          = Normalise::toVariable($preset['field']);
                $entity->$property = $preset['value'];
            }
        }

        $this->unitOfWork->scheduleForInsertion($entity);
    }
51075
public function update($instance, $entity = null)
    {
        list($instance, $entity) = $this->reassignEntity($instance, $entity);

        return new UpdateQuery(
            $this->connection,
            $instance,
            $this->models->get($entity),
            $this->factory,
            $this->accessor,
            $this->dispatcher
        );
    }
358298
public function validate(EntityInterface $entity)
    {
        if (!$entity instanceof UserGroup) {
            throw new Exception(
                sprintf('The Entity to validate must be an instance of %s', Role::class)
            );
        }

        $this->validateName($entity->getName());
        $this->validateDefaultRole($entity->getDefaultRole());
        $errors = $this->getErrors();

        return empty($errors);
    }
1371171
private function updateActiveRow(Entity $entity) {
		$reflection = $entity->getColumns();
		$record = array();
		foreach ($reflection as $property) {
			$name = $property['name'];
			if ($entity->toRow()->$name != $entity->$name) {
				$record[$name] = $entity->$name;
			}
		}
		if (count($record) > 0) {
			$entity->toRow()->update($record);
		}
		$this->addLoop($entity);
	}
434306
public function scheduleForSynchronization(object $document) : void
    {
        $class                                                                       = $this->dm->getClassMetadata(get_class($document));
        $this->scheduledForSynchronization[$class->name][spl_object_hash($document)] = $document;
    }
530434
@Override
	public void update(Object entity) {
		if (entity == null) {
			throw new IllegalArgumentException("'entity' must not be [" + entity + "]");
		}
		
		assertTransactional();
		((AppEngineGlobalTransaction) transaction.get()).coordinator().update(entity);
	}
1237694
public function update($entity)
    {
        $this->gateway->update($this->tableName, $this->builder->reduce($entity), $this->getIdentifier($entity));
        $this->builder->resolve($entity);
    }
1292882
public function preUpdate(PreUpdateEventArgs $args)
    {
        $entity = $args->getObject();

        /** @var object $entity */
        if (true === in_array(EditableEntityTrait::class, class_uses($entity))) {
            $entity->setUpdated(new DateTime());
        }
    }
585687
public function update(AbstractEntity $entity)
    {
        if ($this->updatedTimestampColumn) {
            $entity->exchangeArray([$this->updatedTimestampColumn => time()]);
        }

        if ($this->updatedDatetimeColumn) {
            $entity->exchangeArray([$this->updatedDatetimeColumn => date('Y-m-d H:i:s')]);
        }

        $this->updateRow($entity);

        return $entity;
    }
909094
public function persist(AbstractEntity $entity)
    {
        if ($this->prepareEntityForPersist($entity)) {
            $this->getRepository()->persist($entity);
        }

        $this->afterPersist($entity);
    }
861250
public function persist(AbstractEntity $entity)
    {
        $update = $entity->getId() !== null;

        for ($i = count($this->registries) - 1; $i >= 0; $i--) {
            /** @var RegistryInterface $registry */
            $registry = $this->registries[ $i ];
            if ($update) {
                $registry->update($entity->getId(), $entity);
            } else {
                $registry->add($entity->getId(), $entity);
            }
        }
    }
1282345
private function scheduleForInsert($object)
    {
        $oid = spl_object_hash($object);
        $class = $this->manager->getClassMetadata(get_class($object));

        $this->documentInsertions[$oid] = $object;

        if (null !== $class->getSingleIdentifier($object)) {
            $this->addToIdentityMap($object);
        }
    }
703503
public function update($entity)
    {
        $eloquentModel = $this->getEloquentModel($entity, true);

        $this->updateRelations($eloquentModel, 'update');

        $eloquentModel->save();

        $eloquentModel->afterSaving($entity, 'update');
    }
875087
public function scheduleForDelete($entity)
    {
        $oid = spl_object_id($entity);

        if (isset($this->entityInsertions[$oid])) {
            if ($this->isInIdentityMap($entity)) {
                $this->removeFromIdentityMap($entity);
            }

            unset($this->entityInsertions[$oid], $this->entityStates[$oid]);

            return; // entity has not been persisted yet, so nothing more to do.
        }

        if (! $this->isInIdentityMap($entity)) {
            return;
        }

        $this->removeFromIdentityMap($entity);

        unset($this->entityUpdates[$oid]);

        if (! isset($this->entityDeletions[$oid])) {
            $this->entityDeletions[$oid] = $entity;
            $this->entityStates[$oid]    = self::STATE_REMOVED;
        }
    }
1195576
public function scheduleForInsertion($entity)
    {
        $objectHashId                               = $this->entityRegistry->getObjectHashId($entity);
        $this->scheduledForInsertion[$objectHashId] = $entity;
        $this->entityRegistry->setState($entity, EntityStates::QUEUED);
    }
1286047
public function refresh($entity)
    {
        $fields = $this->getFields();

        foreach ($fields as $key => $mapping) {
            $fieldType = $this->fieldManager->get($mapping['fieldtype'], $mapping);
            $getter = 'get' . ucfirst($key);
            $value = $entity->$getter();
            if ($value) {
                $fieldType->set($entity, $value);
            }
        }
    }