getItems

@return array
@throws \Psr\Cache\InvalidArgumentException
169185
public function getItems()
    {
        $state = $this->state;

        return $this->once('items', function () use ($state) {
            $files = $this->getFiles();

            if (!$files) {
                return [];
            }

            $limit = $state->get('list.limit', 100);
            $items = [];

            /** @var \SplFileInfo $file */
            foreach ($files as $file) {
                $item = unserialize(file_get_contents($file->getPathname()));

                $item['id'] = $file->getBasename();

                $items[$file->getMTime()] = $item;
            }

            krsort($items);

            $result = array_slice($items, 0, $limit);

            return $result;
        });
    }
1149005
public function getItemsArray()
    {
        $items = [];

        foreach ($this->getItems() as $item) {
            $items[] = [
                'id'   => $item->getId(),
                'text' => $item->getText(),
            ];
        }

        return $items;
    }
210503
public function getItems()
    {
        if (is_array($this->items)) {
            $this->items = new static($this->items, $this->serviceDescription);
            $this->items->setParent($this);
        }

        return $this->items;
    }
427821
public function getItems(): array
    {
        $available = [];
        $assigned = [];

        foreach (array_keys($this->manager->getRoles()) as $name) {
            $available[$name] = 'role';
        }

        foreach (array_keys($this->manager->getPermissions()) as $name) {
            if ($name[0] != '/') {
                $available[$name] = 'permission';
            }
        }

        foreach ($this->manager->getAssignments($this->userId) as $item) {
            $assigned[$item->roleName] = $available[$item->roleName];
            unset($available[$item->roleName]);
        }

        return [
            'available' => $available,
            'assigned' => $assigned,
        ];
    }
331832
public function getItems()
    {
        $manager = Configs::authManager();
        $available = [];
        foreach (array_keys($manager->getRoles()) as $name) {
            $available[$name] = 'role';
        }

        foreach (array_keys($manager->getPermissions()) as $name) {
            if ($name[0] != '/') {
                $available[$name] = 'permission';
            }
        }

        $assigned = [];
        foreach ($manager->getAssignments($this->id) as $item) {
            $assigned[$item->roleName] = $available[$item->roleName];
            unset($available[$item->roleName]);
        }

        return [
            'available' => $available,
            'assigned' => $assigned,
        ];
    }
138764
protected function getItemsFromDatabase()
    {
        $brandId = $this->repository->make('antares.memory')->make('primary')->get('brand.default');
        if (auth()->guest()) {
            return [];
        }
        $roleId = auth()->user()->roles->first()->id;
        $items  = $this->resolver()->where(['brand_id' => $brandId, 'role_id' => $roleId])->get();
        $return = [];

        foreach ($items as $item) {
            $form       = $item->form;
            $attributes = array_merge($item->getAttributes(), ['action_id' => $form->action_id, 'name' => $form->name]);
            array_push($return, $attributes);
        }
        return $return;
    }
292733
public function getAll()
    {
        $values = json_decode(file_get_contents($this->cacheFile), true);

        if( ! is_array($values)) return [];
        
        foreach ($values as $key => $value) {
            $values[$key] = unserialize($value);
        }
        return $values;
    }
956608
private function getItems()
    {
        if (!is_null($this->items)) {
            return $this->items;
        }

        $cacheKey = $this->buildCacheKey();

        $this->items = Yii::$app->cache->get($cacheKey);

        if (false === $this->items) {
            $relatedFinder = new RelatedFinder;
            $this->items = $relatedFinder->getVideos($this->video_id);

            if (!empty($this->items)) {
                Yii::$app->cache->set($cacheKey, $this->items, 300);
            }
        }

        return $this->items;
    }
135431
public function getAll()
    {
        $this->initializeOnDemand();
        $result = array();

        foreach ($this->cache as $key => $options) {
            $result[$key] = $options[ConstProviderInterface::CACHE_PARAM_VALUE];
        }

        return $result;
    }
312747
protected function _getList()
    {
        $data = array();

        if ($items = $this->_state->getList()) {
            $name = AnInflector::singularize($this->getName());

            foreach ($items as $item) {
                $this->_state->setItem($item);
                $name = null;
                $item = $this->_serializeToArray($item, $name);

                if (count($commands = $this->getToolbarCommands('list'))) {
                    $item['commands'] = $commands;
                }

                $data[] = $item;
            }

            $data = array(
                'data' => $data,
            );
            
            if (is($items, 'AnDomainEntitysetAbstract')) {
                $data['pagination'] = array(
                    'offset' => (int) $items->getOffset(),
                    'limit' => (int) $items->getLimit(),
                    'total' => (int) $items->getTotal(),
                );
            }
        }

        return $data;
    }
476623
public function getRequestItems()
    {
        $items = [];
        foreach ($this->items as $key => $value) {
            $items[] = [
                'Tag' => $key,
                'Value' => $value
            ];
        }
        return $items;
    }
387134
public function getItems()
    {
        $items = new ArrayList();

        // If the value has been set, use that
        if ($this->value != 'unchanged') {
            $sourceObject = $this->getSourceObject();
            if (is_array($sourceObject)) {
                $values = is_array($this->value) ? $this->value : preg_split('/ *, */', trim($this->value));

                foreach ($values as $value) {
                    $item = new stdClass;
                    $item->ID = $value;
                    $item->Title = $sourceObject[$value];
                    $items->push($item);
                }
                return $items;
            }

            // Otherwise, look data up from the linked relation
            if (is_string($this->value)) {
                $ids = explode(',', $this->value);
                foreach ($ids as $id) {
                    if (!is_numeric($id)) {
                        continue;
                    }
                    $item = DataObject::get_by_id($sourceObject, $id);
                    if ($item) {
                        $items->push($item);
                    }
                }
                return $items;
            }
        }

        if ($this->form) {
            $fieldName = $this->name;
            $record = $this->form->getRecord();
            if (is_object($record) && $record->hasMethod($fieldName)) {
                return $record->$fieldName();
            }
        }

        return $items;
    }
1277999
protected function loadCache(): array
    {
        if ($this->_cache === null)
            $this->_cache = Cacher::getInstance()->get($this->getCacheName());

        return $this->_cache;
    }
1345999
public function getItems(array $keys = [])
    {
        $items = [];
        foreach ($keys as $key) {
            $items[] = $this->offsetGet($key);
        }
        if (empty($keys)) {
            $items = $this->items;
        }

        return $items;
    }
463669
protected function getItemsAsArray($items)
    {
        if (is_array($items)) {
            return $items;
        } elseif ($items instanceof self) {
            return $items->all();
        } elseif ($items instanceof Traversable) {
            return iterator_to_array($items);
        }

        return (array) $items;
    }
264501
public function getTotalItems()
    {
        if ($this->totalItems === null) {
            $this->totalItems = count($this->list);
        }

        return $this->totalItems;
    }
1240800
public function get_items() {
        global $DB, $CFG;
        if (is_siteadmin()) {
            $this->sql = preg_replace('/\\%COURSEFILTER\\%/', '<>0', $this->sql);
            $this->sql = preg_replace('/\\%ITEMFILTER\\%/', '<>0', $this->sql);
            return $DB->get_records_sql($this->sql, $this->params, $this->from, $this->limit);
        }
        if ($CFG->debugdeveloper && $this->has_item_that_needs_access_check()) {
            debugging('Caller must ensure that has_item_that_needs_access_check() does not return anything '
                    . 'before calling get_items(). The item list may be incomplete', DEBUG_DEVELOPER);
        }
        $this->retrieve_items();
        $this->save_caches();
        $idx = 0;
        $items = array();
        foreach ($this->itemkeys as $id) {
            if (!array_key_exists($id, $this->accessibleitems) || !$this->accessibleitems[$id]) {
                continue;
            }
            if ($idx >= $this->from) {
                $items[$id] = $this->items[$id];
            }
            $idx++;
            if ($idx >= $this->from + $this->limit) {
                break;
            }
        }
        return $items;
    }