eZ\Publish\Core\Persistence\Legacy\Content\Location\Handler::getDefaultContentStates PHP Method

getDefaultContentStates() protected method

Returns an array of default content states with content state group id as key.
protected getDefaultContentStates ( ) : eZ\Publish\SPI\Persistence\Content\ObjectState[]
return eZ\Publish\SPI\Persistence\Content\ObjectState[]
    protected function getDefaultContentStates()
    {
        $defaultObjectStatesMap = array();
        foreach ($this->objectStateHandler->loadAllGroups() as $objectStateGroup) {
            foreach ($this->objectStateHandler->loadObjectStates($objectStateGroup->id) as $objectState) {
                // Only register the first object state which is the default one.
                $defaultObjectStatesMap[$objectStateGroup->id] = $objectState;
                break;
            }
        }
        return $defaultObjectStatesMap;
    }