Return key/value pairs of all active staff groups

@return array
187223
public function getActiveStaffGroups()
    {
        $sql = "SELECT ggp_id_group, ggp_name
            FROM gems__groups
            WHERE ggp_group_active = 1 AND ggp_staff_members = 1
            ORDER BY ggp_name";

        try {
            $staffGroups = $this->_getSelectPairsCached(__FUNCTION__, $sql, null, 'groups');
        } catch (\Exception $exc) {
            // Intentional fallthrough when no db present
            $staffGroups = array();
        }

        return $staffGroups;
    }
1268579
public function getPrefixGroupedMetaBoxes()
    {
        $fields = $this->getFields();

        // Just group by the field key prefix
        // Ex: home_foo would go in the Home section by default
        $groups = array();
        foreach ($fields as $k => $field) {
            $prefix = current(explode('_', $k));
            if (!array_key_exists($prefix, $groups)) {
                $groups[$prefix] = array();
            }

            $groups[$prefix][] = $k;
        }

        return $groups;
    }
509914
public function getRemoteGroups(): array
    {
        $result = [];

        if (!(bool)Configure::read('Groups.remoteGroups.enabled')) {
            return $result;
        }

        if ((bool)Configure::read('Groups.remoteGroups.LDAP.enabled')) {
            $result = $this->_getLdapGroups();
        }

        return $result;
    }
88739
public static function getAllGroupUidList()
    {
        $data = static::select(array('uid','groups'));
        $group_uid_map = array();
        foreach ($data as $local_ip => $buffer_array) {
            foreach ($buffer_array as $local_port => $items) {
                //$items = ['connection_id'=>['uid'=>x, 'group'=>[x,x..], 'session'=>[..]], 'client_id'=>[..], ..];
                foreach ($items as $connection_id => $info) {
                    if (empty($info['uid']) || empty($info['groups'])) {
                        break;
                    }
                    $uid = $info['uid'];
                    foreach ($info['groups'] as $group_id) {
                        if(!isset($group_uid_map[$group_id])) {
                            $group_uid_map[$group_id] = array();
                        }
                        $group_uid_map[$group_id][$uid] = $uid;
                    }
                }
            }
        }
        return $group_uid_map;
    }
190425
public function getGroups()
    {
        $sql = "SELECT ggp_id_group, ggp_name
            FROM gems__groups
            WHERE ggp_group_active = 1
            ORDER BY ggp_name";

        return $this->util->getTranslated()->getEmptyDropdownArray() +
                $this->_getSelectPairsCached(__FUNCTION__, $sql, null, 'groups');
    }
1310053
public function getGroupsPairs()
    {
        // Check or init cache
        if (!self::$cached_group_pairs) {
            $user_collection = new AdminUserGroupRepository;
            $user_collection->addOrderByField('title');
            $pairs = $user_collection->getPairs('title');

            self::$cached_group_pairs = $pairs;
        }

        return self::$cached_group_pairs;
    }
863498
public static function getPairs(): array
    {
        $languages_from_site = new LanguageEntityRepository();

        // Default language for admin panel
        $default_languages = [
            Constants::ADMIN_LANGUAGE_DEFAULT_SHORT => Constants::ADMIN_LANGUAGE_DEFAULT_FULL
        ];

        return array_merge($default_languages, $languages_from_site->getPairs('full', 'short'));
    }
831787
protected function getKeyAsArray()
    {
        $result = [];
        if ( ! empty( $this->compositeKey )) {
            foreach ($this->compositeKey as $key) {
                $result[$key] = $this->{$key};
            }
        } else {
            $result[$this->getKeyName()] = $this->getKey();
        }

        return $result;
    }
1355964
public function groups()
    {
        $result = [];
        foreach ($this->_config['groups'] as $group) {
            $key = $this->_config['prefix'] . $group;
            if (!isset($this->data[$key])) {
                $this->data[$key] = ['exp' => PHP_INT_MAX, 'val' => 1];
            }
            $value = $this->data[$key]['val'];
            $result[] = $group . $value;
        }

        return $result;
    }
504434
public function getSitesGroups()
    {
        $db = $this->getDb();
        $groups = $db->fetchAll("SELECT DISTINCT `group` FROM " . $this->table);

        $cleanedGroups = array();
        foreach ($groups as $group) {
            $cleanedGroups[] = $group['group'];
        }

        return $cleanedGroups;
    }
1026984
protected function getGroups()
	{
		$groups = array();

		// Get the list of time zones from the server.
		$zones = \DateTimeZone::listIdentifiers();

		// Build the group lists.
		foreach ($zones as $zone)
		{
			// Time zones not in a group we will ignore.
			if (strpos($zone, '/') === false)
			{
				continue;
			}

			// Get the group/locale from the timezone.
			list ($group, $locale) = explode('/', $zone, 2);

			// Only use known groups.
			if (in_array($group, self::$zones))
			{
				// Initialize the group if necessary.
				if (!isset($groups[$group]))
				{
					$groups[$group] = array();
				}

				// Only add options where a locale exists.
				if (!empty($locale))
				{
					$groups[$group][$zone] = Select::option($zone, str_replace('_', ' ', $locale), 'value', 'text', false);
				}
			}
		}

		// Sort the group lists.
		ksort($groups);

		foreach ($groups as &$location)
		{
			sort($location);
		}

		// Merge any additional groups in the XML definition.
		$groups = array_merge(parent::getGroups(), $groups);

		return $groups;
	}
584759
protected function getGroupItems()
	{
		$list = [];
		$isSuper = $this->getView()->access( ['super'] );
		$isAdmin = $this->getView()->access( ['admin'] );

		$manager = \Aimeos\MShop::create( $this->getContext(), 'customer/group' );
		$search = $manager->createSearch();
		$search->setSortations( [$search->sort( '+', 'customer.group.label' )] );

		foreach( $manager->searchItems( $search ) as $groupId => $groupItem )
		{
			if( !$isSuper && in_array( $groupItem->getCode(), ['super'] ) ) {
				continue;
			}

			if( !$isSuper && !$isAdmin && in_array( $groupItem->getCode(), ['super', 'admin', 'editor'] ) ) {
				continue;
			}

			$list[$groupId] = $groupItem;
		}

		return $list;
	}
911613
public function getPrimaryKeyList()
    {
        $ids = [];
        if (count($this) > 0) {
            foreach ($this as $row) {
                $ids[] = $row->getPrimaryKeyValue();
            }
        }
        return $ids;
    }
24607
public function getSearchableKeys()
    {
        return array_values(array_map(function ($value, $key) {
            return (is_array($value) || is_numeric($key) === false) ? $key : $value;
        }, $this->searchable, array_keys($this->searchable)));
    }
1318042
public function getGroups()
    {
        $groups = array();
        foreach ($this->graph->getVertices() as $vertex) {
            $groups[$vertex->getGroup()] = true;
        }

        return array_keys($groups);
    }
105794
public function groupLinksGroupedBySource(){
        return $this->map(function(Link $linkObj){
                        return 
                            ['link' => $linkObj->getAbsoluteUrl(),
                             'source_link' => $linkObj->getParentUrl()];                                
                    })
                    ->unique('link')
                    ->groupBy('source_link');        
    }
360005
public function getListQueuedTask() {
		$result = [];
		if (!CakeSession::check($this->_sessionKey)) {
			return $result;
		}

		$tasks = CakeSession::read($this->_sessionKey);
		if (!is_array($tasks)) {
			return $result;
		}

		return $tasks;
	}