Returns a paginated list of a bucket's contents

@return array
180186
public function getList()
    {
        if (!userHasPermission('admin:cdn:manager:object:browse')) {
            throw new ApiException(
                'You do not have permission to access this resource',
                $oHttpCodes::STATUS_UNAUTHORIZED
            );
        }

        $oInput       = Factory::service('Input');
        $oObjectModel = Factory::model('Object', 'nails/module-cdn');
        $iBucketId    = (int) $oInput->get('bucket_id') ?: null;
        $iPage        = (int) $oInput->get('page') ?: 1;

        if (empty($iBucketId)) {
            throw new ApiException(
                '`bucket_id` is a required field',
                $oHttpCodes::STATUS_BAD_REQUEST
            );
        }

        $aObjects = $oObjectModel->getAll(
            $iPage,
            static::CONFIG_OBJECTS_PER_PAGE,
            ['where' => [['bucket_id', $iBucketId]]]
        );

        return Factory::factory('ApiResponse', 'nails/module-api')
            ->setData(array_map(
                function ($oObj) {
                    $oObj->url->preview = $oObj->is_img ? cdnCrop($oObj->id, 400, 400) : null;
                    return $oObj;
                },
                $aObjects
            ))
            ->setMeta([
                'page'     => $iPage,
                'per_page' => static::CONFIG_OBJECTS_PER_PAGE,
            ]);
    }
908509
protected function getPages()
    {
        $pages = $this->pages;
        ksort($pages);
        $pages = array_values($pages);

        return $pages;
    }
598157
public function getPages()
    {
        $pages = array();

        foreach ($this->children as $child) {
            if ($child instanceof SwatNoteBookChild) {
                $pages = array_merge($pages, $child->getPages());
            }
        }

        return $pages;
    }
891596
public function getPaginators()
    {
        if (!isset($this->paginators)) {
            $res = call_user_func(
                $this->apiProvider,
                'paginator',
                $this->serviceName,
                $this->apiVersion
            );
            $this->paginators = isset($res['pagination'])
                ? $res['pagination']
                : [];
        }

        return $this->paginators;
    }
1045559
public function index()
    {
        $query = $this->Posts->find()->contain([
            'Categories' => ['fields' => ['id', 'title']],
            'Tags' => function (Query $q) {
                return $q->order(['tag' => 'ASC']);
            },
            'Users' => ['fields' => ['id', 'first_name', 'last_name']],
        ]);

        $this->paginate['order'] = ['created' => 'DESC'];

        $posts = $this->paginate($this->Posts->queryFromFilter($query, $this->request->getQueryParams()));

        $this->set(compact('posts'));
    }
1067916
public function contents()
    {
        $files = array();

        for ($i=0; $i < $this->zip->numFiles; $i++) {
            $details = $this->zip->statIndex($i);
            $files[$details['name']] = $details;
        }

        return $files;
    }
351638
public function contents(): NodeList {
        $results = $this->collection()->reduce(function($carry, $node) {
            if ($node->isRemoved()) {
                return $carry;
            }

            return $carry->merge(
                $node->newNodeList($node->childNodes)
            );
        }, $this->newNodeList());

        return $results;
    }
1233593
public function bucket_list($include_default_bucket = true)
	{
		$bucket_list = array();

		foreach ($this->buckets as $bucket_id)
		{
			// skip the default bucket if ignored
			if ( ($include_default_bucket === false) && ($bucket_id === self::DEFAULT_BUCKET) )
			{
				continue;
			}

			$bucket_list[] = $bucket_id;
		}

		return $bucket_list;
	}
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;
    }
687315
public function jsonSerialize(): array
	{
		if($this->pagination === null)
		{
			return $this->toArray();
		}

		return ['data' => $this->toArray(), 'pagination' => $this->pagination->toArray()];
	}
1030915
public function getPaginationMetaData()
    {
        $pagination = [
            'count' => $this->count,
            'offset' => $this->offset,
            'limit' => $this->limit,
            'next_page_params' => $this->getNextPageParams(),
        ];

        return $pagination;
    }
625910
public static function getList()
    {
        return [
            static::CHOICE,
            static::CLOZE,
            static::GRAPHIC,
            static::MATCH,
            static::PAIR,
            static::SET,
            static::WORDS,
            static::OPEN,
            static::SELECTION,
            static::GRID,
            static::CONTENT,
            static::ORDERING,
            static::BOOLEAN,
        ];
    }
620346
public function bucket_get_objects( $options = array() ) {
	 	
	 	$result = null;
	 	if( ! is_array( $options ) ) {
		
			$this->errors[$this->error_count] = 'options not given as array';
			$this->error_count++;
		
		}
		try {
		
			$result = $this->bucket->objects( $options );
		
		}
		catch( \Exception $e ) {
	
			$result = $e;
			$this->errors[$this->error_count] = $e->getServiceException()->getMessage();
			$this->error_count++;
		
		}
		return $result;		
		
	 }
1195913
public function query(): array
    {
        $comments = Comment::with([
            'post' => function ($query) {
                $query->select('id', 'type', 'slug');
            },
        ])->latest()
            ->paginate();

        return [
            'comments' => $comments,
        ];
    }
625179
public function getTocs()
    {
        $tocs = array();

        $nodes = $this->getNodes(function($node) {
            return $node instanceof TocNode;
        });

        foreach ($nodes as $toc) {
            $files = $toc->getFiles();

            foreach ($files as &$file) {
                $file = $this->environment->canonicalUrl($file);
            }

            $tocs[] = $files;
        }

        return $tocs;
    }
1234631
public function index()
    {
        $this->set('groups', $this->paginate($this->Groups, [
            'contain' => [
                'Users' => function ($q) {
                    return $q->select(['Users.id', 'Users.username'])
                        ->order(['Users.username' => 'ASC']);
                }
            ],
            'maxLimit' => 500,
            'limit' => 500
        ]));
        $this->set('_serialize', ['groups']);
    }
1097148
public function getArchives()
    {
        $year = $this->request->param('Year');
        $month = $this->request->param('Month');

        if (!$year || !is_numeric($year)) {
            return new ArrayList();
        }

        $publish_filter = $year . '-';

        if (is_numeric($month)) {
            $publish_filter .= $month . '-';
        }

        return $this->getBlogPosts()->filter(
            'PublishDate:StartsWith', $publish_filter
        );
    }