Returns All Model Items, either all() or paginated().

Filtered by any defined query filters ($queryFilter)
Ordered by Managed Model orderBy and sortBy methods

@return
549984
public function allItems($count = false)
    {
        if (!$this->hasSoftDeleting()) {
            throw new \Exception('Model does not have Soft Deleting');
        }

        $this->query = $this->model->newQuery()->withTrashed();

        return $this->query($count);
    }
353604
public function all()
    {
        $query = $this->model->newQuery()
                             ->select($this->model->getTable().'.*')
                             ->orderBy($this->model->getNameKey())
                             ->distinct();

        if ($this->resourceName) {
            $query->join($this->relationTable, $this->tagKeyName(), '=', $this->model->getTable().'.'.$this->model->getKeyName());
            $query->where($this->resourceNameKey, $this->resourceName);
        }

        return $query->get();
    }
815266
public function getFilters()
    {
        return [
            new Twig_SimpleFilter('add_filter_value', [$this->urlBuilder, 'addFilterValue']),
            new Twig_SimpleFilter('remove_filter_value', [$this->urlBuilder, 'removeFilterValue']),
            new Twig_SimpleFilter('remove_price_range_filter', [$this->urlBuilder, 'removePriceRangeFilter']),
            new Twig_SimpleFilter('add_prev_page', [$this->urlBuilder, 'addPrevPage']),
            new Twig_SimpleFilter('add_page', [$this->urlBuilder, 'addPage']),
            new Twig_SimpleFilter('add_next_page', [$this->urlBuilder, 'addNextPage']),
            new Twig_SimpleFilter('add_sort_by', [$this->urlBuilder, 'addSortBy']),
        ];
    }
1217729
public function getAll(){
        $rest = $this->getService( self::API_PARENTAL_FILTER);
        $rest->GET();

        return $rest->getResultAsArray( models\ParentalControl\Filter::class);
    }
273935
public function getListItems()
    {
        // Create List:
        
        $items = ArrayList::create();
        
        // Obtain Items from Source:
        
        if ($source = $this->owner->getSource()) {
            
            // Obtain Source List:
            
            $list = $source->getListItems();
            
            // Filter List Items (if applicable):
            
            if (in_array(ListFilter::class, class_uses($source))) {
                
                if ($where = $source->getListWhere()) {
                    $list = $list->where($where);
                }
                
                foreach ($source->getListFilters() as $filter) {
                    $list = $list->filter($filter);
                }
                
            }
            
            // Merge List Items:
            
            $items->merge($list);
            
        }
        
        // Sort Items (if applicable):
        
        if ($this->owner->SortItemsBy) {
            $items = $this->sort($items);
        }
        
        // Remove Items without Images (if applicable):
        
        if ($this->owner->ImageItems) {
            
            $items = $items->filterByCallback(function ($item) {
                return $item->hasMetaImage();
            });
            
        }
        
        // Reverse Items (if applicable):
        
        if ($this->owner->ReverseItems) {
            $items = $items->reverse();
        }
        
        // Limit Items (if applicable):
        
        if ($limit = $this->owner->NumberOfItems) {
            $items = $items->limit($limit);
        }
        
        // Paginate Items (if applicable):
        
        if ($this->owner->PaginateItems && $this->owner->SortItemsBy != self::SORT_RANDOM) {
            
            $items = PaginatedList::create($items, $this->getRequest());
            
            $items->setPaginationGetVar($this->owner->getPaginationGetVar());
            
            if ($this->owner->ItemsPerPage) {
                $items->setPageLength($this->owner->ItemsPerPage);
            }
            
        }
        
        // Associate Items with Rendering Component:
        
        foreach ($items as $item) {
            $item->setRenderer($this->owner);
        }
        
        // Answer List:
        
        return $items;
    }
707477
public function get()
    {

        $result = $this->query->select([$this->pageTable().'.*'])->get();

        if ($this->withHidden) {
            return $result;
        }

        return $this->menuFilters->filteredChildren($result,'');

    }
945653
public function getListFilter()
    {
        if ($this->_aListFilter === null) {
            $this->_aListFilter = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("where");
        }

        return $this->_aListFilter;
    }
1300468
public function getAll(){
        $rest = $this->getService( self::API_WIFI_MAC_FILTER);
        $rest->GET();

        return $rest->getResultAsArray( models\WiFi\MacFilter::class);
    }
768547
def index_items(with_pagination = true)
      conditions = Search::Conditions::List.new(params, model_info.data_items)
      conditions.paginate = nil unless with_pagination
      if params[:rel_class] && params[:rel_id] && params[:rel_getter]
        related_info = RademadeAdmin::Model::Graph.instance.model_info(params[:rel_class])
        @related_model = related_info.query_adapter.find(params[:rel_id])
        conditions.base_items = @related_model.send(params[:rel_getter])
      end
      Search::Searcher.new(model_info).search(conditions)
    end
336991
public function getList()
    {
        /** @var DataList $list */
        $list = parent::getList();
        if ($this->modelClass === 'News' && class_exists('Subsite') && Subsite::currentSubsiteID() > 0) {
            $pages = NewsHolderPage::get()->filter(array('SubsiteID' => (int)Subsite::currentSubsiteID()));
            $filter = $pages->column('ID');
            /* Manual join needed because otherwise no items are found. Unknown why. */
            $list = $list->innerJoin('NewsHolderPage_Newsitems', 'NewsHolderPage_Newsitems.NewsID = News.ID')
                ->filter(array('NewsHolderPage_Newsitems.NewsHolderPageID' => $filter));
        }

        return $list;
    }
753024
public function listResources($filter)
    {
        $alias = 'resource';
        $collection = $this->getThisCollection();

        $queryBuilder = $this->getRepository()
            ->createQueryBuilder($alias);

        // Build the filter on resources
        $this->filterQueryBuilder($queryBuilder, $filter, $collection, $alias);

        // Count the total number of resources
        $countQueryBuilder = clone $queryBuilder;
        $collectionIdentifier = $collection->getIdentifier();
        $totalNumberOfRows = $countQueryBuilder
            ->select($countQueryBuilder->expr()->count($alias . '.' . $collectionIdentifier))
            ->getQuery()
            ->getSingleScalarResult();

        // Paginate resources
        $this->paginateQueryBuilder($queryBuilder, $filter);

        // Finally, select all fields
        $queryBuilder->select($alias);

        $returnedResources = $this->loadResourcesFromQueryBuilder($queryBuilder, $this->getThisCollection());

        return Resource::formatResourcesJsonApi($returnedResources, $totalNumberOfRows);
    }
990160
public function actionIndex()
    {
        $user = $this->findModel(Yii::$app->user->id);
        $query = $user->getNotifications()->orderBy(new Expression("IF(ISNULL(read_at),0,1) asc"))->addOrderBy(['created_at' => SORT_DESC]);
        $requestParams = Yii::$app->getRequest()->getBodyParams();
        if (empty($requestParams)) {
            $requestParams = Yii::$app->getRequest()->getQueryParams();
        }
        $filter = null;
        $dataFilter = Yii::createObject([
            'class' => ActiveDataFilter::class,
            'searchModel' => function () {
                return (new DynamicModel(['verb' => null]))
                    ->addRule('verb', 'string');
            },
        ]);
        if ($dataFilter->load($requestParams)) {
            $filter = $dataFilter->build();
            if ($filter === false) {
                return $dataFilter;
            }
        }
        if ($filter) {
            $query->andWhere($filter);
        }
        return Yii::createObject([
            'class' => ActiveDataProvider::class,
            'query' => $query,
            'pagination' => [
                'params' => $requestParams
            ],
            'sort' => [
                'params' => $requestParams
            ],
        ]);
    }
636388
public function getFilters()
    {
        if (is_array($this->filters)) {
            return $this->filters;
        }

        $request = $this->getRequest();
        $toolbarFilters = $request->getPost('toolbarFilters', $request->getQuery('toolbarFilters'));
        $filters = [];
        if (($request->isPost() === true || $request->isGet() === true) &&
            null !== $toolbarFilters
        ) {
            foreach ($toolbarFilters as $uniqueId => $value) {
                if ($value != '') {
                    foreach ($this->getColumns() as $column) {
                        /* @var $column \ZfcDatagrid\Column\AbstractColumn */
                        if ($column->getUniqueId() == $uniqueId) {
                            $filter = new \ZfcDatagrid\Filter();
                            $filter->setFromColumn($column, $value);

                            $filters[] = $filter;

                            $column->setFilterActive($filter->getDisplayColumnValue());
                        }
                    }
                }
            }
        }

        if (! empty($filters)) {
            $this->filters = $filters;
        } else {
            // No user sorting -> get default sorting
            $this->filters = $this->getFiltersDefault();
        }

        return $this->filters;
    }
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]
979438
public function getIterator(IteratorFilter $filter = null)
    {
        if (is_null($filter)) {
            $filter = new IteratorFilter();
        }

        $param = [];
        $formatter = new IteratorFilterSqlFormatter();
        $sql = $formatter->getFilter($filter->getRawFilters(), $param);

        $query = Query::getInstance()
            ->table($this->getUserDefinition()->table())
            ->where($sql, $param);

        return $this->userRepository->getByQuery($query);
    }
586220
public function getData()
    {
        /**
         * Eloquent's built in "paginate" method does not work well when the query contains "join", "having", or "groupby"
         * so to make things work more reliably we just create the paginator object by hand after running the query
         * TODO: find a way to not use the Paginator Facade
         */
        if ($this->options['paginate'])
        {
            $currentPage = \Paginator::getCurrentPage();

            $total = (int) $this->getQuery()->count();
            $slice = $this->getQuery()->forPage($currentPage, $this->perPage)->get();

            $models = \Paginator::make($slice->all(), $total, $this->perPage);
        } else {
            $models =  $this->getQuery()->get();
        }

        return $models;
    }
1362980
public function actionIndex()
    {
        $filterModel = new Search($this->type);
        return $this->render('index', [
            'filterModel'  => $filterModel,
            'dataProvider' => $filterModel->search(\Yii::$app->request->get()),
        ]);
    }