Load all groups from the given identifiers

@param array $idList
@param string $withAccess

@return Group[]
506938
public function loadAll($idList = [], $withAccess = true)
    {
        $ret = [];

        if (empty($idList)) {
            return $ret;
        }

        $q = $this
            ->database
            ->select('ucms_group', 'g')
        ;

        if ($withAccess) {
            $q->addTag('ucms_group_access');
        }

        $groups = $q
            ->fields('g')
            ->condition('g.id', $idList)
            ->execute()
            ->fetchAll(\PDO::FETCH_CLASS, Group::class)
        ;

        // Ensure order is the same
        // FIXME: find a better way
        $sort = [];
        foreach ($groups as $group) {
            $sort[$group->getId()] = $group;
        }
        foreach ($idList as $id) {
            if (isset($sort[$id])) {
                $ret[$id] = $sort[$id];
            }
        }

        return $ret;
    }
35245
public function loadGroupByIdentifier($identifier)
    {
        $groups = $this->mapper->extractGroupsFromRows(
            $this->contentTypeGateway->loadGroupDataByIdentifier($identifier)
        );

        if (count($groups) !== 1) {
            throw new Exception\TypeGroupNotFound($identifier);
        }

        return $groups[0];
    }
912054
public function loginpage_idp_list($wantsurl) {
        if (empty($this->config->hostname)) {
            // CAS is not configured.
            return [];
        }

        $iconurl = moodle_url::make_pluginfile_url(
            context_system::instance()->id,
            'auth_cas',
            'logo',
            null,
            '/',
            $this->config->auth_logo);

        return [
            [
                'url' => new moodle_url(get_login_url(), [
                        'authCAS' => 'CAS',
                    ]),
                'iconurl' => $iconurl,
                'name' => format_string($this->config->auth_name),
            ],
        ];
    }
653369
public function with($withs)
    {
        if ( ! is_array($withs)) {
            $withs = func_get_args();
        }

        $this->withs = $withs;

        return $this;
    }
85557
public static function getApisearchHeaders(RepositoryWithCredentials $repository): array
    {
        return [
            self::APP_ID_HEADER => $repository->getAppUUID()->composeUUID(),
            self::TOKEN_ID_HEADER => $repository->getTokenUUID()->composeUUID(),
        ];
    }
979537
protected function getDocumentIdGroups(Rootline $pageAccessRootline)
    {
        $groups = $pageAccessRootline->getGroups();
        $groups = Rootline::cleanGroupArray($groups);

        if (empty($groups)) {
            $groups[] = 0;
        }

        $groups = implode(',', $groups);

        return $groups;
    }
386223
private function rebuildAccessoriesSortIndexes(ListModel $inputList): array
    {

        $counter = 0;
        $outputList = [];
        foreach ($inputList as $key => $value) {
            if (isset($value->oxaccessoire2article__oxsort)) {
                if ($value->oxaccessoire2article__oxsort->value != $counter) {
                    $value->oxaccessoire2article__oxsort = new Field($counter);
                    $value->save();
                }
            }
            $outputList[$counter] = $key;
            $counter++;
        }

        return $outputList;
    }
237827
static function countryList( $withVariations = true )
    {
        $countries =& $GLOBALS['eZLocaleCountryList'];
        if ( !is_array( $countries ) )
        {
            $localeRegexp = eZLocale::localeRegexp( $withVariations, false );
            $countries = array();
            $dir = opendir( 'share/locale' );
            while( ( $file = readdir( $dir ) ) !== false )
            {
                if ( preg_match( "/^$localeRegexp\.ini$/", $file, $regs ) )
                {
                    $countries[] = $regs[3];
                }
            }
            closedir( $dir );
            $countries = array_unique( $countries );
            sort( $countries );
        }
        return $countries;
    }
1228088
public function getMethods( $withMagics = TRUE )
	{
		if( $withMagics )
			return $this->methods;
		else
		{
			$methods	= array();
			foreach( $this->methods as $method )
				if( substr( $method->getName(), 0, 2 ) !== "__" )
					$methods[$method->getName()]	= $method;
			return $methods;
		}
	}
81079
public function getAccessListItems($accessType = PermissionKey::ACCESS_TYPE_INCLUDE, $filterEntities = [], $checkCache = true)
    {
        if (count($this->paIDList) > 0) {
            $q = 'select paID, peID, pdID, accessType from PermissionAccessList where paID in (' . implode(',', $this->paIDList) . ')';

            return $this->deliverAccessListItems($q, $accessType, $filterEntities);
        }
        // Sometimes we want to disable cache checking here because we're going to be
        // adding items to the cache from a class that subclasses this one. See
        // AddBlockToAreaAreaAccess
        if ($checkCache) {
            $app = Application::getFacadeApplication();
            $cache = $app->make('cache/request');
            $item = $cache->getItem($this->getCacheIdentifier($accessType, $filterEntities));
            if (!$item->isMiss()) {
                return $item->get();
            }
            $item->lock();
        }

        $q = 'select paID, peID, pdID, accessType from PermissionAccessList where paID = ' . $this->getPermissionAccessID();
        $items = $this->deliverAccessListItems($q, $accessType, $filterEntities);

        if ($checkCache) {
            $cache->save($item->set($items));
        }

        return $items;
    }
458879
public function getAccessListItems($accessType = PermissionKey::ACCESS_TYPE_INCLUDE, $filterEntities = [], $checkCache = true)
    {
        $app = Application::getFacadeApplication();
        if ($checkCache) {
            $cache = $app->make('cache/request');
            $item = $cache->getItem($this->getCacheIdentifier($accessType, $filterEntities));
            if (!$item->isMiss()) {
                return $item->get();
            }
            $item->lock();
        }
        $db = $app->make(Connection::class);
        $list = parent::getAccessListItems($accessType, $filterEntities, false);
        $pobj = $this->getPermissionObjectToCheck();
        foreach ($list as $l) {
            $pe = $l->getAccessEntityObject();
            if ($pobj instanceof Page) {
                $permission = $db->fetchColumn('select permission from BlockTypePermissionBlockTypeAccessList where paID = ?', [$l->getPermissionAccessID()]);
            } else {
                $permission = $db->fetchColumn('select permission from AreaPermissionBlockTypeAccessList where peID = ? and paID = ?', [$pe->getAccessEntityID(), $l->getPermissionAccessID()]);
            }
            if ($permission != 'N' && $permission != 'C') {
                $permission = 'A';
            }
            $l->setBlockTypesAllowedPermission($permission);
            if ($permission == 'C') {
                if ($pobj instanceof Area) {
                    $rs = $db->executeQuery('select btID from AreaPermissionBlockTypeAccessListCustom where peID = ? and paID = ?', [$pe->getAccessEntityID(), $l->getPermissionAccessID()]);
                } else {
                    $rs = $db->executeQuery('select btID from BlockTypePermissionBlockTypeAccessListCustom where paID = ?', [$l->getPermissionAccessID()]);
                }
                $btIDs = [];
                while (($btID = $rs->fetchColumn()) !== false) {
                    $btIDs[] = (int) $btID;
                }
                $l->setBlockTypesAllowedArray($btIDs);
            }
        }

        if ($checkCache) {
            $cache->save($item->set($list));
        }

        return $list;
    }
1102058
public function loadFile($with = array())
    {
        return $this->getManager()->loadModel($this->owner->{$this->idAttribute}, $with);
    }
355798
public function find($id, array $with = [])
    {
        $key = $this->getKey($id, $with);

        $tags = $this->getTags($id, $with);

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

        $model = $this->repo->find($id, $with);

        $this->cache->put($key, $model, $tags);

        return $model;
    }
282875
public function loadGroups(EventInterface $event) {
        $query = new GroupQuery();
        $params = $event->getRequest()->query;

        if ($params->has('page')) {
            $query->page($params->get('page'));
        }

        if ($params->has('limit')) {
            $query->limit($params->get('limit'));
        }

        $response = $event->getResponse();
        $aclAdapter = $event->getAccessControl();

        // Create the model and set some pagination values
        $model = new GroupsModel();
        $model->setLimit($query->limit())
              ->setPage($query->page());

        $groups = $aclAdapter->getGroups($query, $model);
        $modelGroups = [];

        foreach ($groups as $groupName => $resources) {
            $modelGroups[] = [
                'name' => $groupName,
                'resources' => $resources,
            ];
        }

        $model->setGroups($modelGroups);
        $response->setModel($model);
    }
541677
protected function getRequiredUseClasses(array $fields, $withAuth)
    {
        $commands = [];
        if ($withAuth) {
            $commands[] = $this->getUseClassCommand('Auth');
        }

        foreach ($fields as $field) {
            // Extract the name spaces fromt he custom rules
            $customRules = $this->extractCustomValidationRules($field->getValidationRule());
            $namespaces = $this->extractCustomValidationNamespaces($customRules);
            foreach ($namespaces as $namespace) {
                $commands[] = $this->getUseClassCommand($namespace);
            }
        }

        usort($commands, function ($a, $b) {
            return strlen($a) - strlen($b);
        });

        return implode(PHP_EOL, array_unique($commands));
    }
952483
public function loadContentTypeGroupsByIdentifiers(array $identifiers)
    {
        $contentTypeGroups = array_map(
            function ($identifier) {
                try {
                    return $this->contentTypeService->loadContentTypeGroupByIdentifier($identifier);
                } catch (NotFoundException $notFoundException) {
                    return $this->createContentTypeGroupByIdentifier($identifier);
                }
            },
            $identifiers
        );

        return $contentTypeGroups;
    }
1302419
public function getGroups( \Aimeos\MShop\Context\Item\Iface $context )
	{
		$list = array();
		$manager = \Aimeos\MShop::create( $context, 'customer/group' );

		$search = $manager->createSearch();
		$search->setConditions( $search->compare( '==', 'customer.group.id', $context->getGroupIds() ) );

		foreach( $manager->searchItems( $search ) as $item ) {
			$list[] = $item->getCode();
		}

		return $list;
	}