lib/Form/ObjectStateType.php
private function getObjectStates(Options $options): array
    {
        $allObjectStates = [];

        $groups = $this->objectStateService->loadObjectStateGroups();
        $configuredGroups = $options['states'];

        foreach ($groups as $group) {
            $configuredGroups += [$group->identifier => true];
            if ($configuredGroups[$group->identifier] === false) {
                continue;
            }

            $objectStates = $this->objectStateService->loadObjectStates($group);

            foreach ($objectStates as $objectState) {
                if (
                    is_array($configuredGroups[$group->identifier]) &&
                    !in_array($objectState->identifier, $configuredGroups[$group->identifier], true)
                ) {
                    continue;
                }

                $groupName = $group->getName() ?? $group->identifier;
                $stateName = $objectState->getName() ?? $objectState->identifier;

                $allObjectStates[$groupName][$stateName] = $group->identifier . '|' . $objectState->identifier;
            }
        }

        return $allObjectStates;
    }
private function getObjectStates(Options $options): array
    {
        $allObjectStates = [];

        $groups = $this->objectStateService->loadObjectStateGroups();
        $configuredGroups = $options['states'];

        foreach ($groups as $group) {
            $configuredGroups += [$group->identifier => true];
            if ($configuredGroups[$group->identifier] === false) {
                continue;
            }

            $objectStates = $this->objectStateService->loadObjectStates($group);

            foreach ($objectStates as $objectState) {
                if (
                    is_array($configuredGroups[$group->identifier]) &&
                    !in_array($objectState->identifier, $configuredGroups[$group->identifier], true)
                ) {
                    continue;
                }

                $groupName = $group->getName() ?? $group->identifier;
                $stateName = $objectState->getName() ?? $objectState->identifier;

                $allObjectStates[$groupName][$stateName] = $group->identifier . '|' . $objectState->identifier;
            }
        }

        return $allObjectStates;
    }
private function getObjectStates ( Options $ options ) : array { $ allObjectStates = [ ] ; $ groups = $ this -> objectStateService -> loadObjectStateGroups ( ) ; $ configuredGroups = $ options [ 'states' ] ; foreach ( $ groups as $ group ) { $ configuredGroups += [ $ group -> identifier => true ] ; if ( $ configuredGroups [ $ group -> identifier ] === false ) { continue ; } $ objectStates = $ this -> objectStateService -> loadObjectStates ( $ group ) ; foreach ( $ objectStates as $ objectState ) { if ( is_array ( $ configuredGroups [ $ group -> identifier ] ) && ! in_array ( $ objectState -> identifier , $ configuredGroups [ $ group -> identifier ] , true ) ) { continue ; } $ groupName = $ group -> getName ( ) ?? $ group -> identifier ; $ stateName = $ objectState -> getName ( ) ?? $ objectState -> identifier ; $ allObjectStates [ $ groupName ] [ $ stateName ] = $ group -> identifier . '|' . $ objectState -> identifier ; } } return $ allObjectStates ; }
Returns the allowed content states from eZ Platform.
Returns the allowed content states from eZ Platform .