Updates the stored object state with provided data.

@param \eZ\Publish\SPI\Persistence\Content\ObjectState $objectState
15123
public function updateObjectState(ObjectState $objectState)
    {
        // First update the state
        $query = $this->dbHandler->createUpdateQuery();
        $query->update(
            $this->dbHandler->quoteTable('ezcobj_state')
        )->set(
            $this->dbHandler->quoteColumn('default_language_id'),
            $query->bindValue(
                $this->maskGenerator->generateLanguageIndicator($objectState->defaultLanguage, false),
                null,
                \PDO::PARAM_INT
            )
        )->set(
            $this->dbHandler->quoteColumn('identifier'),
            $query->bindValue($objectState->identifier)
        )->set(
            $this->dbHandler->quoteColumn('language_mask'),
            $query->bindValue(
                $this->maskGenerator->generateLanguageMaskFromLanguageCodes($objectState->languageCodes, true),
                null,
                ParameterType::INTEGER
            )
        )->where(
            $query->expr->eq(
                $this->dbHandler->quoteColumn('id'),
                $query->bindValue($objectState->id, null, \PDO::PARAM_INT)
            )
        );

        $query->prepare()->execute();

        // And then refresh object state translations
        // by removing existing ones and adding new ones
        $this->deleteObjectStateTranslations($objectState->id);
        $this->insertObjectStateTranslations($objectState);
    }
17677
public function updateFromObject(stdClass $object)
    {

        $this->name  = property_exists($object, 'name') ? $object->name : null;
        $this->email = property_exists($object, 'email') ? $object->email : null;
    }
1048992
public function updateMessage(DataObject $object, $identifier)
    {
        $this->changeMessage(sprintf('Updating %s.%s', get_class($object), $identifier), 'changed');
    }
970132
public function loadObjectState($objectStateGroupId, $objectStateId)
    {
        return new RestObjectState(
            $this->objectStateService->loadObjectState($objectStateId, Language::ALL),
            $objectStateGroupId
        );
    }
1324523
public function insertObjectStateGroup(Group $objectStateGroup)
    {
        try {
            return $this->innerGateway->insertObjectStateGroup($objectStateGroup);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
1108856
public function save($entity)
    {

        $objectManager = $this->getObjectManager();

        //@TODO UnitOfWork::STATE_NEW == $em->getUnitOfWork()->getEntityState($entity)
        //@see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/working-with-objects.html#entity-state
        $objectManager->persist($entity);
        $objectManager->flush();
    }
199653
public function addState($state)
    {
        $this->_states[$state] = $state;

        if ($this->_currentState === null) {
            $this->_currentState = $state;
        }
    }
1372900
public int update(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException {
		if (mappedUpdate == null) {
			mappedUpdate = MappedUpdate.build(dao, tableInfo);
		}
		int result = mappedUpdate.update(databaseConnection, data, objectCache);
		if (dao != null && !localIsInBatchMode.get()) {
			dao.notifyChanges();
		}
		return result;
	}
896353
public void updateItemState(ItemState itemState) throws RepositoryException
   {
      if (itemState.isDeleted())
      {
         throw new RepositoryException("Illegal state DELETED. Use delete(...) method");
      }

      changesLog.add(itemState);
   }
750477
public function updateFromObject(stdClass $object)
    {
        $this->bodyParts               = EmailBodyPartCollection::createFromObjects(property_exists($object, 'bodyParts') ? $object->bodyParts : null);
        $this->contentTransferEncoding = $object->contentTransferEncoding;
        $this->contentType             = $object->contentType;
        $this->rawContent              = property_exists($object, 'rawContent') ? $object->rawContent : null;
    }
749488
public function storeObjectAttribute($objectAttribute)
    {
        $value = $this->storage->storeFieldData($objectAttribute, $objectAttribute->content());

        $objectAttribute->setAttribute(self::RICH_TEXT_FIELD, (string)$value);
    }
868180
protected function _setState($state)
    {
        if ($state !== null && !($state instanceof MapInterface)) {
            throw $this->_createInvalidArgumentException(
                $this->__('Argument is not a valid map'), null, null, $state
            );
        }

        $this->state = $state;
    }
332334
public function createObjectState($objectStateGroupId, Request $request)
    {
        $objectStateGroup = $this->objectStateService->loadObjectStateGroup($objectStateGroupId);

        try {
            $createdObjectState = $this->objectStateService->createObjectState(
                $objectStateGroup,
                $this->inputDispatcher->parse(
                    new Message(
                        array('Content-Type' => $request->headers->get('Content-Type')),
                        $request->getContent()
                    )
                )
            );
        } catch (InvalidArgumentException $e) {
            throw new ForbiddenException($e->getMessage());
        }

        return new Values\CreatedObjectState(
            array(
                'objectState' => new RestObjectState(
                    $createdObjectState,
                    $objectStateGroup->id
                ),
            )
        );
    }
270362
public function update($stateId, InputStruct $input)
    {
        $objectState = $this->objectStateMapper->createObjectStateFromInputStruct($input);
        $objectState->id = (int)$stateId;

        $this->objectStateGateway->updateObjectState($objectState);

        return $this->load($objectState->id);
    }
1331977
public function setState(\Core\Entity\State $state = null)
    {
        $this->state = $state;

        return $this;
    }
538
protected function setState($state)
    {
        if (!in_array($state, $this->config['states'])) {
            throw new SMException(sprintf(
                'Cannot set the state to "%s" to object "%s" with graph %s because it is not pre-defined.',
                $state,
                get_class($this->object),
                $this->config['graph']
            ));
        }

        $accessor = new PropertyAccessor();
        $accessor->setValue($this->object, $this->config['property_path'], $state);
    }
1367213
public function onPostSerialize(ObjectEvent $event)
    {
        $visitor = $event->getVisitor();
        $document = $event->getObject();

        if (!$document instanceof ParentBehavior || !$document->getParent() instanceof UuidBehavior) {
            return;
        }

        $visitor->addData('parentUuid', $document->getParent()->getUuid());
    }