Apply the typical age range updated event to the offer repository.
@param AbstractTypicalAgeRangeUpdated $typicalAgeRangeUpdated
@return JsonDocument
777353
protected function applyTypicalAgeRangeUpdated(
        AbstractTypicalAgeRangeUpdated $typicalAgeRangeUpdated
    ) {
        $document = $this->loadDocumentFromRepository($typicalAgeRangeUpdated);

        $offerLd = $document->getBody();
        $offerLd->typicalAgeRange = (string) $typicalAgeRangeUpdated->getTypicalAgeRange();

        return $document->withBody($offerLd);
    }
8700
public function update($json, ChildrenOrderSaverMapperInterface $mapper)
    {
        $array = $this->parse($json);

        foreach ($array as $range => $value) {
            if (is_array($value)) {
                $mapper->save($value[RelationBuilder::TREE_PARAM_ID], $value[RelationBuilder::TREE_PARAM_PARENT_ID], $range);
            }
        }

        return true;
    }
269515
function updateUserProfileWithToken(messagingToken) {
  const currentUserUid =
    firebase.auth().currentUser && firebase.auth().currentUser.uid
  if (!currentUserUid) {
    return Promise.resolve();
  }
  return firebase
    .firestore()
    .collection('users')
    .doc(currentUserUid)
    .update({
      messaging: {
        mostRecentToken: messagingToken,
        updatedAt: firebase.firestore.FieldValue.serverTimestamp()
      }
    })
}
633626
public function updatedBy($guid)
    {
        $model = $this->noInitModel;
        if (!is_string($model->updatedByAttribute)) {
            return $this;
        }
        if ($guid instanceof BaseUserModel) {
            $guid = $guid->getGUID();
        }
        return $this->andWhere([$model->updatedByAttribute => new Binary($guid, Binary::TYPE_UUID)]);
    }
1336078
public function AllHistoricalChildren()
    {
        /** @var DataObject|Versioned|Hierarchy $owner */
        $owner = $this->owner;
        if (!$owner->hasExtension(Versioned::class) || !$owner->hasStages()) {
            throw new Exception(
                'Hierarchy->AllHistoricalChildren() only works with Versioned extension applied with staging'
            );
        }

        $baseTable = $owner->baseTable();
        $parentIDColumn = $owner->getSchema()->sqlColumnForField($owner, 'ParentID');
        return Versioned::get_including_deleted(
            $owner->baseClass(),
            [ $parentIDColumn => $owner->ID ],
            "\"{$baseTable}\".\"ID\" ASC"
        );
    }
491789
function updateFromParent( $forceUpdate = false )
    {
        $mainNode = eZContentObjectTreeNode::findMainNode( $this->attribute( 'contentobject_id' ), true );
        if ( !is_object( $mainNode ) )
        {
            eZDebug::writeDebug( 'mainNode not found', 'eZPaEx::updateFromParent' );
        }
        elseif ( $mainNode->attribute( 'depth' ) > 1 )
        {
            $parentMainNodeID = $mainNode->attribute('parent_node_id');
            $parentContentObject = eZContentObject::fetchByNodeID( $parentMainNodeID );
            $parentPaex = eZPaEx::getPaEx($parentContentObject->attribute('id'));
            if ( $parentPaex instanceof eZPaEx )
            {
                $paexUpdated = false;

                if ( !$this->hasRegexp() || $forceUpdate )
                {
                    $this->setAttribute( 'passwordvalidationregexp', $parentPaex->attribute( 'passwordvalidationregexp' ) );
                    $paexUpdated = true;
                }

                if ( !$this->hasLifeTime() || $forceUpdate )
                {
                    $this->setAttribute( 'passwordlifetime', $parentPaex->attribute( 'passwordlifetime' ) );
                    $paexUpdated = true;
                }

                if ( !$this->hasNotification() || $forceUpdate )
                {
                    $this->setAttribute( 'expirationnotification', $parentPaex->attribute( 'expirationnotification' ) );
                    $paexUpdated = true;
                }

                if ( $paexUpdated )
                {
                    eZDebug::writeDebug( 'Paex updated from parent', 'eZPaEx::updateFromParent' );
                    $this->store();
                }
            }
        }

        return true;
    }
1053330
protected function applyOrganizerUpdated(AbstractOrganizerUpdated $organizerUpdated)
    {
        $document = $this->loadDocumentFromRepository($organizerUpdated);

        $offerLd = $document->getBody();

        $offerLd->organizer = array(
                '@type' => 'Organizer',
            ) + (array)$this->organizerJSONLD($organizerUpdated->getOrganizerId());

        return $document->withBody($offerLd);
    }
1352948
public function updateVersion($contentId, $versionNo, UpdateStruct $struct)
    {
        try {
            return $this->innerGateway->updateVersion($contentId, $versionNo, $struct);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
868795
protected function applyImageUpdated(AbstractImageUpdated $imageUpdated)
    {
        $document = $this->loadDocumentFromRepository($imageUpdated);

        $offerLd = $document->getBody();

        if (!isset($offerLd->mediaObject)) {
            throw new \Exception('The image to update could not be found.');
        }

        $updatedMediaObjects = [];

        foreach ($offerLd->mediaObject as $mediaObject) {
            $mediaObjectMatches = (
                strpos(
                    $mediaObject->{'@id'},
                    (string)$imageUpdated->getMediaObjectId()
                ) > 0
            );

            if ($mediaObjectMatches) {
                $mediaObject->description = (string)$imageUpdated->getDescription();
                $mediaObject->copyrightHolder = (string)$imageUpdated->getCopyrightHolder();

                $updatedMediaObjects[] = $mediaObject;
            }
        };

        if (empty($updatedMediaObjects)) {
            throw new \Exception('The image to update could not be found.');
        }

        return $document->withBody($offerLd);
    }
652586
function touch(token, cb) {
  var date = stampify(conf.session_maxage);
  db.getClient(function(err, client, done) {
    client.query("UPDATE tokens SET expires_at = $1 WHERE token = $2", [date, token], function() {
      cb.apply(null, arguments);
      done();
    });
  });
}
1139341
private function doModify(AbstractUserEvent $event)
    {
        $this->classMetadata->modifyProperty(
            $event->getUser(),
            new \DateTime(sprintf('@%s', $this->requestStack->getMasterRequest()->server->get('REQUEST_TIME'))),
            ClassMetadata::LAST_ACTION_PROPERTY
        );
    }
770797
public function getUpdates($lastUpdateId = null, int $limit = 5, int $timeout = 30) : \Generator
    {
        if ($lastUpdateId !== null) {
            $this->lastUpdateId = $lastUpdateId;
        }

        $method = new GetUpdates($this->lastUpdateId + 1, $limit, $timeout);

        $updates = yield from $this->execute($method);
        $this->lastUpdateId = $method->getLastUpdateId();

        return $updates;
    }
487442
@Test
    public void outdated_scenario() throws JSONException {
        httpPost("keys", jsonKey.toString(), 201);

        try {
            // Add two outdated translations
            sendTranslationUpdate("zztranslation", EN, true);
            sendTranslationUpdate("translation", FR, true);

            // Update the default translation
            jsonKey.put("translation", "updated translation");
            httpPut("keys/" + keyName, jsonKey.toString(), 200);

            // The key should remain outdated
            assertOutdatedStatus(true);

            // Update English translations
            sendTranslationUpdate("updated translation", EN, false);

            // The key should remain outdated
            assertOutdatedStatus(true);

            // Update French translations
            sendTranslationUpdate("updated translation", FR, false);

            // Now, all the translation have been updated
            assertOutdatedStatus(false);

        } finally {
            // clean the repo
            httpDelete("keys/" + keyName, 204);
        }
    }
34477
def updateAcqEraEndDate(self, **kwargs):
        
        validParameters = ['end_date', 'acquisition_era_name']

        requiredParameters = {'forced': validParameters}

        checkInputParameter(method="updateAcqEraEndDate", parameters=kwargs.keys(), validParameters=validParameters,
                            requiredParameters=requiredParameters)

        return self.__callServer("acquisitioneras", params=kwargs, callmethod='PUT')
845935
protected function genericUpdateDelegatePosition(ModelCriteria $query, UpdatePositionEvent $event, EventDispatcherInterface $dispatcher = null)
    {
        if (null !== $object = $query->findOne()) {
            if (!isset(class_uses($object)['Thelia\Model\Tools\PositionManagementTrait'])) {
                throw new \InvalidArgumentException("Your model does not implement the PositionManagementTrait trait");
            }

            //$object->setDispatcher($dispatcher !== null ? $dispatcher : $event->getDispatcher());

            $mode = $event->getMode();

            if ($mode == UpdatePositionEvent::POSITION_ABSOLUTE) {
                $object->changeAbsolutePosition($event->getPosition());
            } elseif ($mode == UpdatePositionEvent::POSITION_UP) {
                $object->movePositionUp();
            } elseif ($mode == UpdatePositionEvent::POSITION_DOWN) {
                $object->movePositionDown();
            }
        }
    }
149661
protected static function defaultUpdateResponse(
        int $updated,
        string $index,
        UriInterface $requestUri,
        CrudInterface $crud,
        EncoderInterface $encoder
    ): ResponseInterface {
        $responses = static::defaultCreateResponses($requestUri, $encoder);
        if ($updated > 0 && ($model = $crud->read($index)) !== null) {
            assert(!($model instanceof PaginatedDataInterface));
            $response = $responses->getContentResponse($model);
        } else {
            $response = $responses->getCodeResponse(404);
        }

        return $response;
    }
495123
public function update()
    {
        $this->exitIfModelNotSet();

        if (!$this->model->exists) {
            throw new \Exception('Model not persisted yet');
        }

        $document = $this->model->getDocumentData();

        $params = [
            'id'    => $this->model->getKey(),
            'type'  => $this->model->getDocumentType(),
            'index' => $this->model->getDocumentIndex(),
            'body'  => [
                'doc' => $document,
            ],
        ];

        return $this->connection->updateStatement($params);
    }