Generates an array of the groups and their fixtures

@param string[] $groups
163053
private function addGroupsFixtureMapping(string $className, array $groups) : void
    {
        foreach ($groups as $group) {
            $this->groupsFixtureMapping[$group][$className] = true;
        }
    }
340933
public void setGroups(java.util.Collection<GroupType> groups) {
        if (groups == null) {
            this.groups = null;
            return;
        }

        this.groups = new java.util.ArrayList<GroupType>(groups);
    }
988507
public function controllers(array $controllers)
    {
        $group = new Group;
        foreach ($controllers as $controller)
            $group->set($this->controller($controller));
        return $group;
    }
1307486
public static function map_in_groups($groups = null)
    {
        $groupIDList = array();

        if ($groups instanceof SS_List) {
            foreach ($groups as $group) {
                $groupIDList[] = $group->ID;
            }
        } elseif (is_array($groups)) {
            $groupIDList = $groups;
        } elseif ($groups) {
            $groupIDList[] = $groups;
        }

        // No groups, return all Members
        if (!$groupIDList) {
            return static::get()->sort(array('Surname' => 'ASC', 'FirstName' => 'ASC'))->map();
        }

        $membersList = new ArrayList();
        // This is a bit ineffective, but follow the ORM style
        /** @var Group $group */
        foreach (Group::get()->byIDs($groupIDList) as $group) {
            $membersList->merge($group->Members());
        }

        $membersList->removeDuplicates('ID');

        return $membersList->map();
    }
557617
public function reverseTransform($groups)
    {
        $value = new ArrayCollection();
        if (is_array($groups) && array_key_exists('groups_collection', $groups)) {
            $groups = $groups['groups_collection'];
            foreach ($groups as $groupId => $group) {
                if (array_key_exists('group', $group) && $group['group']) {
                    $group = $this->groupRepository->find($groupId);
                    if (null !== $group && in_array($group->getSite()->getId(), $this->availableSiteIds)) {
                        $value->add($group);
                    }
                }
            }
        }

        return $value;
    }
1295744
private function buildMiddlewareQueue(array $groups)
    {
        $queue = [];
        $middlewareList = $this->config('app')['middleware'];

        $groupsIterator = new \RecursiveIteratorIterator(
            new \RecursiveArrayIterator($groups)
        );

        foreach ($groupsIterator as $middleware) {
            $current = $middlewareList[$middleware];

            foreach ((array) $current as $curr) {
                $queue[] = $curr;
            }
        }

        return $queue;
    }
795454
public function setGroups(array $groups)
    {
        foreach ($groups as $groupIdent => $groupStruct) {
            if (!is_array($groupStruct)) {
                throw new InvalidArgumentException(sprintf(
                    'The attachment group "%s" must be an array of attachable objects',
                    $groupIdent
                ));
            }

            if (isset($groupStruct['ident'])) {
                $groupIdent = $groupStruct['ident'];
                unset($groupStruct['ident']);
            }

            if (!is_string($groupIdent)) {
                throw new InvalidArgumentException(
                    'The attachment group identifier must be a string'
                );
            }

            if (isset($groupStruct['attachable_objects'])) {
                $groupStruct = $groupStruct['attachable_objects'];
            } elseif (isset($groupStruct['attachables'])) {
                $groupStruct = $groupStruct['attachables'];
            }

            $this->groups[$groupIdent] = $groupStruct;
        }

        return $this;
    }
158967
public function addGroup($group)
    {
        if (null === $this->groups) {
            $this->groups = [];
        }
        if (!in_array($group, $this->groups)) {
            $this->groups[] = $group;
        }

        return $this;
    }
323560
protected function checkGroups(array $groups)
    {
        $checkedGroups = array();
        foreach ($groups as $group) {
            if (true === is_string($group) && false === in_array($group, $checkedGroups)) {
                $checkedGroups[] = (string)$group;
            }
        }
        return $checkedGroups;
    }
75808
private function getUserGroupIds($groups)
    {
        $userGroups = [];

        foreach ($groups as $group) {
            $userGroup = Craft::$app->userGroups->getGroupByHandle($group);
            $userGroups[] = $userGroup->id;
        }

        return $userGroups;
    }
444306
private function addGroup($group)
	{
		if($group != null)
		{
			if($this->_groups == null)
				$this->_groups = array();
			$this->_groups[] = $group;
		}
	}
266017
public function setGroups($groups)
    {
        foreach ($groups as $key => $dtoData) {
            $this->groups[$key] = new GroupDto($dtoData);
        }
    
        return $this;
    }
690931
public static function create_groups($groups) {
        global $CFG, $DB;
        require_once("$CFG->dirroot/group/lib.php");

        $params = self::validate_parameters(self::create_groups_parameters(), array('groups'=>$groups));

        $transaction = $DB->start_delegated_transaction();

        $groups = array();

        foreach ($params['groups'] as $group) {
            $group = (object)$group;

            if (trim($group->name) == '') {
                throw new invalid_parameter_exception('Invalid group name');
            }
            if ($DB->get_record('groups', array('courseid'=>$group->courseid, 'name'=>$group->name))) {
                throw new invalid_parameter_exception('Group with the same name already exists in the course');
            }

            // now security checks
            $context = context_course::instance($group->courseid, IGNORE_MISSING);
            try {
                self::validate_context($context);
            } catch (Exception $e) {
                $exceptionparam = new stdClass();
                $exceptionparam->message = $e->getMessage();
                $exceptionparam->courseid = $group->courseid;
                throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam);
            }
            require_capability('moodle/course:managegroups', $context);

            // Validate format.
            $group->descriptionformat = external_validate_format($group->descriptionformat);

            // finally create the group
            $group->id = groups_create_group($group, false);
            if (!isset($group->enrolmentkey)) {
                $group->enrolmentkey = '';
            }
            if (!isset($group->idnumber)) {
                $group->idnumber = '';
            }

            $groups[] = (array)$group;
        }

        $transaction->allow_commit();

        return $groups;
    }
793622
private function buildGroups()
    {
        $this->groups = [];
        $allGroups = $this->initialData[self::GROUPS] ?? [];
        foreach ($allGroups as $action => $groups) {
            \arsort($groups);
            $this->groups[$action] = \array_keys($groups);
        }
    }
1175793
public function createFormGroup(array $attributes = [])
    {
        $this->childNodes->push(new Group($attributes));

        return $this->childNodes->last();
    }
449838
protected function resolveGroupAndWhen($collections)
    {
        if (count(RouteCollector::getGroups())) {
            $collections = $this->resolveGroupCollections($collections);
        }

        if (isset($collections['WHEN'])) {
            $collections = $this->resolveWhenCollections($collections['WHEN']);
        }

        if (count($groups = RouteCollector::getGroups())) {
            $collections = $this->resolveGroupCollections($groups);
        }

        return $collections;
    }
259647
public function loadFromArrayForGroups($object)
    {
        parent::loadFromArray($object);

        if (!empty($object->items)) {
            foreach($object->items AS &$item) {
                $Group = new Group();
                $Group->loadFromArray($item);

                $item = $Group;
            }
        }