Notifies search engine about updates to object states

@since 4.1
@param int $objectID
@param array $objectStateList
@return false|mixed False in case method is undefined, otherwise return the result of the search engine call
160323
public static function updateObjectState( $objectID, $objectStateList )
    {
        $searchEngine = eZSearch::getEngine();

        if ( $searchEngine instanceof ezpSearchEngine && method_exists( $searchEngine, 'updateObjectState' ) )
        {
            return $searchEngine->updateObjectState( $objectID, $objectStateList );
        }

        return false;
    }
715436
@Override
  public final boolean setRoutingObjectID(DBID objectID) {
    if(objectID == routingObjectID || DBIDUtil.equal(objectID, routingObjectID)) {
      return false;
    }
    this.routingObjectID = objectID;
    return true;
  }
1306068
public function loadObjectStates($objectStateGroupId)
    {
        $objectStateGroup = $this->objectStateService->loadObjectStateGroup($objectStateGroupId);

        return new Values\ObjectStateList(
            $this->objectStateService->loadObjectStates($objectStateGroup, Language::ALL),
            $objectStateGroup->id
        );
    }
309712
def _object_set_to_state_list(self, objectset):
        
        state_list = []
        for state in list(objectset):
            state_list.append(state.stateid)
        return state_list
534571
public function objectIdChanged(string $objectType, string $oldObjectId, string $newObjectId)
    {
        //==============================================================================
        // Create Event Object
        $event = new ObjectsIdChangedEvent($this->getWebserviceId(), $objectType, $oldObjectId, $newObjectId);
        //==============================================================================
        //      Dispatch Event
        $this->getEventDispatcher()->dispatch(ObjectsIdChangedEvent::NAME, $event);

        return true;
    }
400289
protected function update($step)
    {
        $objectStateService = $this->repository->getObjectStateService();

        $groupsCollection = $this->matchObjectStateGroups('update', $step);

        if (count($groupsCollection) > 1 && isset($step->dsl['references'])) {
            throw new \Exception("Can not execute Object State Group update because multiple groups match, and a references section is specified in the dsl. References can be set when only 1 state group matches");
        }

        if (count($groupsCollection) > 1 && isset($step->dsl['identifier'])) {
            throw new \Exception("Can not execute Object State Group update because multiple groups match, and an identifier is specified in the dsl.");
        }

        foreach ($groupsCollection as $objectStateGroup) {
            $objectStateGroupUpdateStruct = $objectStateService->newObjectStateGroupUpdateStruct();

            if (isset($step->dsl['identifier'])) {
                $objectStateGroupUpdateStruct->identifier = $this->referenceResolver->resolveReference($step->dsl['identifier']);
            }
            if (isset($step->dsl['names'])) {
                foreach ($step->dsl['names'] as $languageCode => $name) {
                    $objectStateGroupUpdateStruct->names[$languageCode] = $name;
                }
            }
            if (isset($step->dsl['descriptions'])) {
                foreach ($step->dsl['descriptions'] as $languageCode => $description) {
                    $objectStateGroupUpdateStruct->descriptions[$languageCode] = $description;
                }
            }
            $objectStateGroup = $objectStateService->updateObjectStateGroup($objectStateGroup, $objectStateGroupUpdateStruct);

            $this->setReferences($objectStateGroup, $step);
        }

        return $groupsCollection;
    }
970132
public function loadObjectState($objectStateGroupId, $objectStateId)
    {
        return new RestObjectState(
            $this->objectStateService->loadObjectState($objectStateId, Language::ALL),
            $objectStateGroupId
        );
    }
734227
public function setObjectState($object, $state)
    {
        if (is_object($object)) {
            $oid = spl_object_hash($object);
            $repository = $this->objectsRepository[$oid];
            $data = $repository->getHydrator()->unhydrate($object);
            $id = isset($data['_id']) ? serialize($data['_id']) . $repository->getCollection() : $oid;
        } else {
            return false;
        }

        if (!isset($this->objectStates[$id]) && !isset($this->objectStates[$oid])) {
            throw new Exception\StateException();
        }

        if (!in_array($state, [self::OBJ_MANAGED, self::OBJ_NEW, self::OBJ_REMOVED])) {
            throw new Exception\StateException("Invalid state '$state'");
        }

        if ($state == self::OBJ_REMOVED && isset($this->objectStates[$oid]) && $this->objectStates[$oid] == self::OBJ_NEW) {
            throw new Exception\StateException("Can't change state to removed because object is not managed. Insert it in database before");
        }

        if (isset($this->objectStates[$oid])) {
            unset($this->objectStates[$oid]);
            unset($this->objects[$oid]);
        }

        $this->objectStates[$id] = $state;
        $this->objects[$id] = $object;

        return true;
    }
763291
protected function validateEzObject($objectId)
    {
        try {
            $this->contentHandler->loadContentInfo($objectId);
        } catch (NotFoundException $e) {
            return false;
        }

        return true;
    }
958608
public function load($objectId)
    {
        $success = null;
        $value   = $this->adapter->getItem($objectId, $success);

        if ($success) {
            return $value;
        }

        return null;
    }
522175
protected function checkObjects($objectMap) {
    $response = $this->getResponse();
    $invalidOids = [];
    foreach ($objectMap as $parameterName => $object) {
      if ($object == null) {
        $invalidOids[] = $parameterName;
      }
    }
    if (sizeof($invalidOids) > 0) {
      $response->addError(ApplicationError::get('OID_INVALID',
        ['invalidOids' => $invalidOids]));
      return false;
    }
    return true;
  }
659198
public function updateObjectStateGroup($objectStateGroupId, Request $request)
    {
        $updateStruct = $this->inputDispatcher->parse(
            new Message(
                array('Content-Type' => $request->headers->get('Content-Type')),
                $request->getContent()
            )
        );

        $objectStateGroup = $this->objectStateService->loadObjectStateGroup($objectStateGroupId);

        try {
            $updatedStateGroup = $this->objectStateService->updateObjectStateGroup($objectStateGroup, $updateStruct);

            return $updatedStateGroup;
        } catch (InvalidArgumentException $e) {
            throw new ForbiddenException($e->getMessage());
        }
    }
1174540
public function readRecursively($objectID, $status = null) {
        $children = $this->read($objectID, $status);

        $tree = [];

        foreach ($children as $child) {
            if (!array_key_exists('id', $child)) {
                throw new RuntimeException('Broken result');
            }

            $node = $child;

            $childChildren = $this->read((int) $child['id'], $status);

            if (count($childChildren) > 0) {
                $node['children'] = $childChildren;
            }

            $tree[] = $node;
        }

        return $tree;
    }
28425
static public function fetchRelatedObjectsCount( $objectID, $attributeID, $allRelations )
    {
        if ( !is_numeric( $objectID ) )
        {
            eZDebug::writeError( "ObjectID is missing", __METHOD__ );
            return false;
        }

        $object = eZContentObject::fetch( $objectID );
        if ( !$object instanceof eZContentObject )
        {
            eZDebug::writeError( "An error occured fetching object #$objectID", __METHOD__ );
            return false;
        }

        $params=array();
        if ( !$attributeID )
        {
            $attributeID = 0;
        }

        if ( isset( $allRelations ) )
        {
            if ( $attributeID && !$allRelations )
            {
                $params['AllRelations'] = eZContentFunctionCollection::contentobjectRelationTypeMask( array( 'attribute' ) );
            }
            elseif( $allRelations === true )
            {
                $attributeID = false;
            }
            else
            {
                $params['AllRelations'] = eZContentFunctionCollection::contentobjectRelationTypeMask( $allRelations );
            }
        }

        if ( $attributeID && !is_numeric( $attributeID ) && !is_bool( $attributeID ) )
        {
            $attributeID = eZContentObjectTreeNode::classAttributeIDByIdentifier( $attributeID );
            if ( !$attributeID )
            {
                eZDebug::writeError( "Can't get class attribute ID by identifier" );
                return false;
            }
        }

        return array( 'result' => $object->relatedContentObjectCount( false, $attributeID, $params ) );
    }
631758
public function deleteAction(Request $request, ObjectState $objectState): Response
    {
        $this->denyAccessUnlessGranted(new Attribute('state', 'administrate'));
        $form = $this->formFactory->create(
            ObjectStateDeleteType::class,
            new ObjectStateDeleteData($objectState)
        );
        $form->handleRequest($request);

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function (ObjectStateDeleteData $data) {
                $objectState = $data->getObjectState();
                $this->objectStateService->deleteObjectState($objectState);

                $this->notificationHandler->success(
                    $this->translator->trans(
                        /** @Desc("Object state '%name%' deleted.") */
                        'object_state.delete.success',
                        ['%name%' => $objectState->getName()],
                        'object_state'
                    )
                );
            });

            if ($result instanceof Response) {
                return $result;
            }
        }

        return $this->redirectToRoute('ezplatform.object_state.group.view', [
            'objectStateGroupId' => $objectState->getObjectStateGroup()->id,
        ]);
    }
928249
public function getObjectUrl($repositoryId, $objectId, $selector = null)
    {
        if ($this->getRootUrl($repositoryId) === null) {
            return null;
        }

        $url = $this->buildUrl($this->getRootUrl($repositoryId));
        $urlQuery = $url->getQuery();
        $urlQuery->modify([Constants::PARAM_OBJECT_ID => (string) $objectId]);

        if (!empty($selector)) {
            $urlQuery->modify([Constants::PARAM_SELECTOR => (string) $selector]);
        }

        return $url;
    }
37979
public function load($stateId)
    {
        $data = $this->objectStateGateway->loadObjectStateData($stateId);

        if (empty($data)) {
            throw new NotFoundException('ObjectState', $stateId);
        }

        return $this->objectStateMapper->createObjectStateFromData($data);
    }