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;
    }
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;
    }
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 ; }
Merges setting array for a set of groups.

@param array $groups array of group name
@param string $id id of the setting array under ezpublish.<base_key>.<group_name>
@param array $config the full configuration array
@param int $options only static::MERGE_FROM_SECOND_LEVEL or static::UNIQUE are recognized

@return array
Merges setting array for a set of groups .