eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\Contextualizer::groupsArraySetting PHP Метод

groupsArraySetting() приватный Метод

Merges setting array for a set of groups.
private groupsArraySetting ( array $groups, string $id, array $config, integer $options ) : array
$groups array array of group name
$id string id of the setting array under ezpublish..
$config array the full configuration array
$options integer only static::MERGE_FROM_SECOND_LEVEL or static::UNIQUE are recognized
Результат array
    private function groupsArraySetting(array $groups, $id, array $config, $options = 0)
    {
        $groupsSettings = array();
        sort($groups);
        foreach ($groups as $group) {
            if (isset($config[$this->siteAccessNodeName][$group][$id])) {
                if ($options & static::MERGE_FROM_SECOND_LEVEL) {
                    foreach (array_keys($config[$this->siteAccessNodeName][$group][$id]) as $key) {
                        if (!isset($groupsSettings[$key])) {
                            $groupsSettings[$key] = $config[$this->siteAccessNodeName][$group][$id][$key];
                        } else {
                            // array_merge() has to be used because we don't
                            // know whether we have a hash or a plain array
                            $groupsSettings[$key] = array_merge($groupsSettings[$key], $config[$this->siteAccessNodeName][$group][$id][$key]);
                        }
                    }
                } else {
                    // array_merge() has to be used because we don't
                    // know whether we have a hash or a plain array
                    $groupsSettings = array_merge($groupsSettings, $config[$this->siteAccessNodeName][$group][$id]);
                }
            }
        }
        return $groupsSettings;
    }