Returns the `group value` for each of the configured groups
If the group initial value was not found, then it initializes
the group accordingly.

@return array
488213
public function groups()
    {
        $result = [];
        foreach ($this->_config['groups'] as $group) {
            $value = xcache_get($this->_config['prefix'] . $group);
            if (!$value) {
                $value = 1;
                xcache_set($this->_config['prefix'] . $group, $value, 0);
            }
            $result[] = $group . $value;
        }

        return $result;
    }
1166829
public function groups()
    {
        if ($this->groups === null) {
            $ident    = $this->ident();
            $metadata = $this->adminSecondaryMenu();

            $this->groups = [];
            if (isset($metadata[$ident]['groups'])) {
                $groups = $metadata[$ident]['groups'];

                if (is_array($groups)) {
                    $this->setGroups($groups);
                }
            }
        }

        return $this->groups;
    }
316093
public function getGroups()
	{
		if (!is_array($this->_xml))
		{

			return false;
		}

		$results = array();
		foreach ($this->_xml as $name => $group)
		{
			$results[$name] = $this->getNumParams($name);
		}

		return $results;
	}
309522
public function getDefaultValues()
    {
        preg_match('/([0-9.]+)([A-Z]{3})/', $this->config['price'], $matches);

        $this->defaults['price'] = array(
            'currency' => (!empty($this->defaults['price']['currency']) ? $this->defaults['price']['currency'] : $matches[2]),
            'amount' => (!empty($this->defaults['price']['amount']) ? $this->defaults['price']['amount'] : $matches[1]),
            'vat' => (!empty($this->defaults['price']['vat']) ? $this->defaults['price']['vat'] : null),
        );

        return $this->defaults;
    }
506498
protected function _group()
    {
        $result = [];
        foreach ($this->_parts['group'] as $name => $value) {
            $result[] = $this->dialect()->name($name);
        }
        return $fields = join(', ', $result);
    }
724296
public function groups()
    {
        $result = [];
        foreach ($this->_config['groups'] as $group) {
            $value = $this->_Redis->get($this->_config['prefix'] . $group);
            if (!$value) {
                $value = 1;
                $this->_Redis->set($this->_config['prefix'] . $group, $value);
            }
            $result[] = $group . $value;
        }

        return $result;
    }
111630
public function getAsGroupedArray(): array
    {
        $result = array();

        foreach ($this->_groups as $groupName => $memberKeys) {
            $members = array();

            foreach ($memberKeys as $key) {
                $members[$key] = $this->getFieldAsArray($key);
            }

            $result[$groupName] = array(
                'group_name' => $groupName,
                'group_caption' => $this->_('group_' . $groupName),
                'fields' => $members
            );
        }

        return $result;
    }
429070
protected function _getDefaultValues()
    {
        $teamComponent = $this->_data->parent->parent->parent;
        if (Kwc_Abstract::hasSetting($teamComponent->componentClass, 'defaultVcardValues')) {
            $setting = Kwc_Abstract::getSetting($teamComponent->componentClass, 'defaultVcardValues');
        }

        if (isset($setting)) {
            return $setting;
        } else {
            return Kwc_Abstract::getSetting($this->_data->componentClass, 'defaultVcardValues');
        }
    }
1066971
public function all()
    {
        $data = new stdClass();
        foreach ($this->findAll() as $model) {
            $value = is_numeric($model->value) ? (int) $model->value : $model->value;
            $group_name = $model->group_name;
            $key_name = $model->key_name;
            if ($group_name != 'config') {
                if (!isset($data->$group_name)) {
                    $data->$group_name = new stdClass();
                }
                $data->$group_name->$key_name = $value;
            } else {
                $data->$key_name = $value;
            }
        }

        return $data;
    }
1035388
public function setGroup()
    {
        // set group position if exist

        $group = [];

        foreach ($this->data['group'] as $table => $params) {

            $params = array_flip($params);

            if (empty($params) === false) {

                foreach ($params as $field) {
                    $group[] = $table . '.' . $field;
                }
            }
        }
        $this->builder->groupBy($group);

        return null;
    }
895116
protected function _getGroupPrice()
    {
        $sPriceSufix = $this->_getUserPriceSufix();
        $sVarName = "oxarticles__oxprice{$sPriceSufix}";
        $dPrice = $this->$sVarName->value;

        // #1437/1436C - added config option, and check for zero A,B,C price values
        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blOverrideZeroABCPrices') && (double) $dPrice == 0) {
            $dPrice = $this->oxarticles__oxprice->value;
        }

        return $dPrice;
    }
1146011
public function groups()
    {
        if (empty($this->_compiledGroupNames)) {
            foreach ($this->_config['groups'] as $group) {
                $this->_compiledGroupNames[] = $this->_config['prefix'] . $group;
            }
        }

        $groups = wincache_ucache_get($this->_compiledGroupNames);
        if (count($groups) !== count($this->_config['groups'])) {
            foreach ($this->_compiledGroupNames as $group) {
                if (!isset($groups[$group])) {
                    wincache_ucache_set($group, 1);
                    $groups[$group] = 1;
                }
            }
            ksort($groups);
        }

        $result = [];
        $groups = array_values($groups);
        foreach ($this->_config['groups'] as $i => $group) {
            $result[] = $group . $groups[$i];
        }

        return $result;
    }
183912
protected function getUserGroups()
	{
		// Initialise variables.
		$db = App::get('db');
		$query = $db->getQuery()
			->select('a.id', 'value')
			->select('a.title', 'text')
			->select('COUNT(DISTINCT b.id)', 'level')
			->select('a.parent_id')
			->from('#__usergroups', 'a')
			->joinRaw('#__usergroups AS b', 'a.lft > b.lft AND a.rgt < b.rgt', 'left')
			->group('a.id')
			->group('a.title')
			->group('a.lft')
			->group('a.rgt')
			->group('a.parent_id')
			->order('a.lft', 'ASC');
		$db->setQuery($query->toString());
		$options = $db->loadObjectList();

		return $options;
	}
335866
public function groups()
    {
        $return = ['everyone'];

        $groups = GroupMember::where('user_id', $this->id())
            ->sort('`group` ASC')
            ->all();

        foreach ($groups as $group) {
            $return[] = $group->group;
        }

        return $return;
    }
472032
public function getGroup() {

		$groupTable = CmnTables::getTableName( CmnTables::TABLE_GROUP );

		return $this->hasOne( Group::class, [ 'id' => 'groupId' ] )->from( "$groupTable group" );
	}
1363893
public function groups()
    {
        if (empty($this->_compiledGroupNames)) {
            foreach ($this->_config['groups'] as $group) {
                $this->_compiledGroupNames[] = $this->_config['prefix'] . $group;
            }
        }

        $groups = $this->_Memcached->getMulti($this->_compiledGroupNames) ?: [];
        if (count($groups) !== count($this->_config['groups'])) {
            foreach ($this->_compiledGroupNames as $group) {
                if (!isset($groups[$group])) {
                    $this->_Memcached->set($group, 1, 0);
                    $groups[$group] = 1;
                }
            }
            ksort($groups);
        }

        $result = [];
        $groups = array_values($groups);
        foreach ($this->_config['groups'] as $i => $group) {
            $result[] = $group . $groups[$i];
        }

        return $result;
    }
408863
protected function findOrCreateAdminGroup()
    {
        // Check pre-existing group
        $adminGroup = Permission::get_groups_by_permission('ADMIN')->first();
        if ($adminGroup) {
            return $adminGroup;
        }

        // Check if default records create the group
        Group::singleton()->requireDefaultRecords();
        $adminGroup = Permission::get_groups_by_permission('ADMIN')->first();
        if ($adminGroup) {
            return $adminGroup;
        }

        // Create new admin group directly
        $adminGroup = Group::create();
        $adminGroup->Code = 'administrators';
        $adminGroup->Title = _t('SilverStripe\\Security\\Group.DefaultGroupTitleAdministrators', 'Administrators');
        $adminGroup->Sort = 0;
        $adminGroup->write();
        Permission::grant($adminGroup->ID, 'ADMIN');
        return $adminGroup;
    }