public function getPage(int $page, array $options = null)
    {

        $params = $this->preparePageParams($page, $options ?? []);

        // Log Debug
        $this->flow->getLogger()
            ->debug("Retrieving Resource List: $this->endpoint, $page, $this->id");

        // Get the BasicResponse from the Adapter
        $response = $this->flow->send(
            'get',
            $this->endpoint . '/' . ($options['method'] ?? $this->paginationMethod ?? 'list'),
            $params
        );

        $items = [];

        // For each item in the `data` key, transform it as this Service Resource or the class
        foreach ($response['data'] ?? [] as $item) {
            $items[] = $this->make($item);
        }

        // Becauze Zend Engine uses copy-on-write, we didn't use foreach by reference
        $response['items'] = $items;

        unset($response['data']);

        // Return the paged BasicResponse
        return (new PagedResponse($response))->page($page);
    }
public function getPage(int $page, array $options = null)
    {

        $params = $this->preparePageParams($page, $options ?? []);

        // Log Debug
        $this->flow->getLogger()
            ->debug("Retrieving Resource List: $this->endpoint, $page, $this->id");

        // Get the BasicResponse from the Adapter
        $response = $this->flow->send(
            'get',
            $this->endpoint . '/' . ($options['method'] ?? $this->paginationMethod ?? 'list'),
            $params
        );

        $items = [];

        // For each item in the `data` key, transform it as this Service Resource or the class
        foreach ($response['data'] ?? [] as $item) {
            $items[] = $this->make($item);
        }

        // Becauze Zend Engine uses copy-on-write, we didn't use foreach by reference
        $response['items'] = $items;

        unset($response['data']);

        // Return the paged BasicResponse
        return (new PagedResponse($response))->page($page);
    }
public function getPage ( int $ page , array $ options = null ) { $ params = $ this -> preparePageParams ( $ page , $ options ?? [ ] ) ; // Log Debug $ this -> flow -> getLogger ( ) -> debug ( "Retrieving Resource List: $this->endpoint, $page, $this->id" ) ; // Get the BasicResponse from the Adapter $ response = $ this -> flow -> send ( 'get' , $ this -> endpoint . '/' . ( $ options [ 'method' ] ?? $ this -> paginationMethod ?? 'list' ) , $ params ) ; $ items = [ ] ; // For each item in the `data` key, transform it as this Service Resource or the class foreach ( $ response [ 'data' ] ?? [ ] as $ item ) { $ items [ ] = $ this -> make ( $ item ) ; } // Becauze Zend Engine uses copy-on-write, we didn't use foreach by reference $ response [ 'items' ] = $ items ; unset ( $ response [ 'data' ] ) ; // Return the paged BasicResponse return ( new PagedResponse ( $ response ) ) -> page ( $ page ) ; }
Gets a Page of Resources from the Service

@param int $page
@param array|null $options
@return PagedResponse
@throws \Exception
Gets a Page of Resources from the Service