Get all resources, automatically paging through data

@return array
181967
public function all()
    {
        $data = [];

        $page      = 1;
        $fetch_all = true;

        $resourceName = constant($this->type . '::RESOURCE');
        $url          = sprintf("%s/%s", self::ENDPOINT, $resourceName);
        if (isset($this->params['page'])) {
            $page      = $this->params['page'];
            $fetch_all = false;
        }

        while (true) {
            $response = $this->fetch($this->buildUrl($url, $this->params), $resourceName);

            if (count($response) > 0) {
                foreach ($response as $item) {
                    $data[] = new $this->type($item);
                }

                if (!$fetch_all) {
                    break;
                } else {
                    $page++;
                    $this->where(['page' => $page]);
                }
            } else {
                break;
            }
        }

        return $data;
    }
1021675
public function getData()
    {
        $limit = $this->getLimit();
        $this->setHeaders();
        $page  = $this->getPage();
        if ($page > 0) {
            $page-=1;
        }
        return $this->getDataSource()->limit($limit)->offset($limit * $page)->getAll();
    }
908509
protected function getPages()
    {
        $pages = $this->pages;
        ksort($pages);
        $pages = array_values($pages);

        return $pages;
    }
209291
public function fetchAll()
    {
        if ($this->usePaginator === true) {
            return $this->initPaginator($this->tableGateway->getSql()->select());
        }
        $this->result = $this->tableGateway->select();

        return $this->result;
    }
20551
public function fetchPairsByResourceName(): array
	{
		$result = [];
		$rows = $this->findByResource();
		foreach ($rows as $row) {
			$result[$row->id] = $row->resource . ($this->translator ? ' - ( ' . $this->translator->translate($row->name) . ' )' : '');
		}
		return $result;
	}
784844
public function getAll(){
        $rest = $this->getService( self::API_VPN_CONNECTION);
        $rest->GET();

        return $rest->getResultAsArray( models\VPN\Server\Connection::class);
    }
1205169
public function getAllMissingResources() {
        $missingResources = [];
        $offset = FALSE;
        $all = TRUE;
        $start_time = time();

        while (!is_null($offset)) {
            $delta = time() - $start_time;

            if ($delta > $this->getTimeOut()) {
                $all = FALSE;
                break;
            }

            if (!$offset) {
                $params = NULL;
            }
            else {
                $params = new MissingResourcesParameters();
                $params->setOffset($offset);
            }

            $response = $this->getMissingResources($params);
            $offset = !empty($response['offset']) ? $response['offset'] : NULL;
            $missingResources = array_merge($missingResources, $response['items']);
        }

        return [
            'items' => $missingResources,
            'all' => $all,
        ];
    }
898994
def _all_resources(self):
        
        queryset = self.__model__.query
        args = {k: v for (k, v) in request.args.items() if k not in ('page', 'export')}
        limit = None
        if args:
            filters = []
            order = []
            for key, value in args.items():
                if value.startswith('%'):
                    filters.append(getattr(self.__model__, key).like(str(value), escape='/'))
                elif key == 'sort':
                    direction = desc if value.startswith('-') else asc
                    order.append(direction(getattr(self.__model__, value.lstrip('-'))))
                elif key == 'limit':
                    limit = int(value)
                elif hasattr(self.__model__, key):
                    filters.append(getattr(self.__model__, key) == value)
                else:
                    raise BadRequestException('Invalid field [{}]'.format(key))
                queryset = queryset.filter(*filters).order_by(*order)
        if 'page' in request.args:
            resources = queryset.paginate(page=int(request.args['page']), per_page=limit).items
        else:
            queryset = queryset.limit(limit)
            resources = queryset.all()
        return [r.to_dict() for r in resources]
1369601
public function fetch()
    {
        $adapter = $this->getAdapter();
        if (!$adapter)
            throw new \Exception("Adapter property is not set");

        $adapter->check($this);
        $adapter->filter($this);
        $adapter->sort($this);
        $result = $adapter->paginate($this);

        $filters = $this->getFilters();
        return [
            'sort_column'   => $this->getSortColumn(),
            'sort_dir'      => $this->getSortDir(),
            'page_number'   => $this->getPageNumber(),
            'page_size'     => $this->getPageSize(),
            'total_pages'   => $this->getTotalPages(),
            'filters'       => count($filters) ? $filters : new \StdClass(),
            'rows'          => $result,
        ];
    }
534065
public function getAvailableResources()
    {
        $cache = Cache::getTransientCache();
        $cacheId = 'transifex_resources_' . $this->projectSlug;
        $resources = $cache->fetch($cacheId);

        if (empty($resources)) {
            $apiPath = 'project/' . $this->projectSlug . '/resources';
            $resources = $this->getApiResults($apiPath);
            $cache->save($cacheId, $resources);
        }

        return $resources;
    }
1097475
public function getAll()
    {
        if (filesize($this->filename) <= static::MAX_FILE_SIZE_FOR_CACHE) {
            $return = $this->query(new Query());
        } else {
            $return = $this->getIterator();
        }

        return $return;
    }
381246
public function getAll()
    {
        return $this->getClient()->call(null, null, self::ENDPOINT, Agenda::class, true, 'GET');
    }
458353
public function index()
    {
        $apiRequest = RequestFactory::create();

        $page = $apiRequest->getPage();
        if (!$page->size()) {
            $page->setSize($this->pageSize);
        }

        $fields = $apiRequest->getFields();
        $sorting = $apiRequest->getSort();
        $included = $apiRequest->getIncludedRelationships();
        $filters = $apiRequest->getFilters();

        $resource = new ListResource($this->serializer, $page, $fields, $sorting, $included, $filters);

        $totalAmount = $this->totalAmountResourceCallable();
        $results = $this->listResourceCallable();

        $controllerAction = '\\'.get_called_class().'@index';
        $uri = $this->uriGenerator($controllerAction);

        return $this->addHeaders($resource->get($totalAmount, $results, $uri, get_class($this->getDataModel())));
    }
371610
public function getDatasourcesAsArray()
    {

        // initialize the array
        $datasources = array();

        // prepare the array with the datasources
        foreach ($this->getDatasources() as $datasource) {
            $datasources[$datasource->getPrimaryKey()] = $datasource;
        }

        // return the array with the datasources
        return $datasources;
    }
168239
protected function getListResource()
    {
        $items = $this->getListItems();
        $count = $items->count();
        /** @var string $treeClass */
        $treeClass = $this->config()->get('tree_class');
        $hal = [
            'count' => $count,
            'total' => $count,
            '_links' => [
                'self' => [
                    'href' => $this->Link('items')
                ]
            ],
            '_embedded' => [$treeClass => []]
        ];
        /** @var ChangeSet $item */
        foreach ($items as $item) {
            $sync = $this->shouldCampaignSync($item);
            $resource = $this->getChangeSetResource($item, $sync);
            $hal['_embedded'][$treeClass][] = $resource;
        }
        return $hal;
    }
17966
protected function getResources() {

        if (empty($this->resources)) {

            // On initialise les variables
            $resources = array();
            $actions   = $this->getActions();

            // On parcourt les sections et on en crée des ressources.
            foreach ($actions as $section) {
                $resources[$section->name] = new Resource($section->name);
            }

            $this->resources = $resources;

        }

        return $this->resources;

    }
217692
public function getConnectionsFromResource() : Array
	{	
		$baseDir = dirname(__DIR__);
		$configLocation = $baseDir . '/config.php';
	
		if (!file_exists($configLocation) && class_exists(Config::class)) {
			$resourceConfig = Config::get('database');
		}else{
			$resourceConfig = include $configLocation;
		}

		if (gettype($resourceConfig) !== 'array') {
			throw new Exception('Invalid configuration type.');
		}
		
		return $resourceConfig;
	}