protected function getSelectionChoices() { $choices = []; foreach ($this->objectStateService->loadObjectStateGroups() as $group) { foreach ($this->objectStateService->loadObjectStates($group) as $state) { $choices[$state->id] = $state->getName($state->defaultLanguageCode); } } return $choices; }
/** * This method returns the ordered list of object states of a group. * * @param \eZ\Publish\API\Repository\Values\ObjectState\ObjectStateGroup $objectStateGroup * * @return \eZ\Publish\API\Repository\Values\ObjectState\ObjectState[] */ public function loadObjectStates(ObjectStateGroup $objectStateGroup) { return $this->service->loadObjectStates($objectStateGroup); }
/** * Returns a list of all object states of the given group. * * @param $objectStateGroupId * * @return \eZ\Publish\Core\REST\Server\Values\ObjectStateList */ public function loadObjectStates($objectStateGroupId) { $objectStateGroup = $this->objectStateService->loadObjectStateGroup($objectStateGroupId); return new Values\ObjectStateList($this->objectStateService->loadObjectStates($objectStateGroup), $objectStateGroup->id); }