Generate list of group id's

@since 4.4
@return array
501497
protected function generateGroupIdList()
    {
        $db         = eZDB::instance();
        $userID     = $this->ContentObjectID;
        $userGroups = $db->arrayQuery( "SELECT  c.contentobject_id as id,c.path_string
                                        FROM ezcontentobject_tree  b,
                                             ezcontentobject_tree  c
                                        WHERE b.contentobject_id='$userID' AND
                                              b.parent_node_id = c.node_id
                                        ORDER BY c.contentobject_id  ");
        $pathArray      = array();
        $userGroupArray = array();
        foreach ( $userGroups as $group )
        {
            $pathItems = explode( '/', $group["path_string"] );
            array_pop( $pathItems );
            array_pop( $pathItems );
            foreach ( $pathItems as $pathItem )
            {
                if ( $pathItem != '' && $pathItem > 1 )
                    $pathArray[] = $pathItem;
            }
            $userGroupArray[] = $group['id'];
        }

        if ( !empty( $pathArray ) )
        {
            $pathArray = array_unique ($pathArray);
            $extraGroups = $db->arrayQuery( "SELECT c.contentobject_id as id
                                            FROM ezcontentobject_tree  c,
                                                 ezcontentobject d
                                            WHERE c.node_id in ( " . implode( ', ', $pathArray ) . " ) AND
                                                  d.id = c.contentobject_id
                                            ORDER BY c.contentobject_id  ");
            foreach ( $extraGroups as $group )
            {
                $userGroupArray[] = $group['id'];
            }
        }
        return $userGroupArray;
    }
781300
protected function getShardIds(): array
    {
        $key = $this->getStreamName() . '.shard_ids';

        if ($this->cache->has($key)) {
            return $this->cache->get($key);
        }

        $res = $this->getClient()->describeStream(['StreamName' => $this->getStreamName()]);
        $shard_ids = $res->search('StreamDescription.Shards[].ShardId');
        // Cache shard_ids for a day as overuse of the describeStream
        // resource results in LimitExceededException error.
        $this->cache->set($key, $shard_ids, 86400);

        return $shard_ids;
    }
725232
public static function get_group_members($groupids) {
        $members = array();

        $params = self::validate_parameters(self::get_group_members_parameters(), array('groupids'=>$groupids));

        foreach ($params['groupids'] as $groupid) {
            // validate params
            $group = groups_get_group($groupid, 'id, courseid, name, enrolmentkey', MUST_EXIST);
            // 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);

            $groupmembers = groups_get_members($group->id, 'u.id', 'lastname ASC, firstname ASC');

            $members[] = array('groupid'=>$groupid, 'userids'=>array_keys($groupmembers));
        }

        return $members;
    }
798041
public function getGroupIds()
    {
        $ids = array();

        /* @var $group \Sokil\UserBundle\Entity\Group */
        foreach ($this->getGroups() as $group) {
            $ids[] = $group->getId();
        }

        return $ids;
    }
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;
    }
1019043
protected function getMemberIDList()
    {
        if (!$this->owner || !$this->owner->exists()) {
            return null;
        }

        if ($this->owner instanceof Group) {
            return $this->owner->Members()->column('ID');
        }

        return [$this->owner->ID];
    }
642268
public function getIncludeUserIds()
    {
        $ids = [];

        foreach ($this->usersToNotify as $user) {
            $ids[] = $user->getId();
        }

        return $ids;
    }
572415
public function getGroups()
    {
        return $this->apiCall('groups.list')->then(function ($response) {
            $groups = [];
            foreach ($response['groups'] as $group) {
                $groups[] = new Group($this, $group);
            }
            return $groups;
        });
    }
334920
public function getIds()
    {
        $ids = array();
        foreach ($this->vertices as $vertex) {
            $ids []= $vertex->getId();
        }
        return $ids;
    }
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;
    }
1092989
public function groupByDataboxIdAndCollectionId()
    {
        $groups = [];

        foreach ($this->references as $index => $reference) {
            $databoxId = $reference->getDataboxId();
            $group = isset($groups[$databoxId]) ? $groups[$databoxId] : [];

            $group[$reference->getCollectionId()] = $index;
            $groups[$databoxId] = $group;
        }

        return $groups;
    }
1103740
public function getIds(): iterable
    {
        $this->checkRepository();

        $primaryKey  = $this->getClassMetadata()->getSingleIdentifierFieldName();

        $result = $this->_em
            ->createQueryBuilder()
            ->select('entity.'.$primaryKey)
            ->from($this->_entityName, 'entity')
            ->getQuery()
            ->getResult(Query::HYDRATE_ARRAY)
        ;

        $array = [];

        foreach ($result as $id) {
            $array[] = $id[$primaryKey];
        }

        return $array;
    }
929654
public function retrieve_group_ids(string $id_option = null, string $id_group): ?array
  {
    return $this->_retrieve_ids($id_option, null, $id_group);
  }
437456
public function getGroupIds($uid){
        
        $groupIds = Db::table($this->dbTablePrefix . $this->tableUserGroup)
                    ->where('user_id',$uid)
                    ->column('group_id');
        
        return $groupIds;
    }
776447
protected function generateGroupOptions() {
		
		$options = array();
		$fields = array('widgetOptions, label', 'labelOptions', 'errorOptions', 'hint', 'hintOptions', 'prepend', 'prependOptions',
			'append', 'appendOptions', 'enableAjaxValidation', 'enableClientValidation');

		foreach ($fields as $prop) {
			if (isset($this->$prop)) {
				$options[$prop] = $this->$prop;
			}
		}
		
		$options['widgetOptions']['data'] = $this->items;

		return $options;
	}
105794
public function groupLinksGroupedBySource(){
        return $this->map(function(Link $linkObj){
                        return 
                            ['link' => $linkObj->getAbsoluteUrl(),
                             'source_link' => $linkObj->getParentUrl()];                                
                    })
                    ->unique('link')
                    ->groupBy('source_link');        
    }
1044707
public function getIds(): array {
        $this->loadMetadata();
        $ids = array();
        foreach ($this->metadata->allResources(RC::idProp()) as $i) {
            $ids[] = $i->getUri();
        }
        return $ids;
    }