src/Controller/GET.php
protected static function handleGET(
        $parameters,
        $modelClass,
        $primaryDataParameters = [],
        $relationshipParameters = []
    ) {
        $page   = $modelClass::parsePage($parameters);
        $filter = $modelClass::parseFilter($parameters);
        $sort   = $modelClass::parseSort($parameters);
        $fields = $modelClass::parseFields($parameters);

        $requestInclude = static::getRequestInclude($parameters, $modelClass);

        $data = $modelClass::get(
            $page,
            $filter,
            $sort,
            $fields,
            ...$primaryDataParameters
        );

        //Get included data
        $includedData = $modelClass::getIncludedData(
            $data,
            $requestInclude,
            $fields,
            $relationshipParameters
        );

        $meta = (object) [
            'page' => (
                $page === null
                ? $modelClass::getDefaultPage()
                : $page
            )
        ];

        return static::viewData(
            $data,
            (object) [
                'self' => $modelClass::getSelfLink()
            ],
            $meta,
            (empty($requestInclude) ? null : $includedData)
        );
    }
protected static function handleGET(
        $parameters,
        $modelClass,
        $primaryDataParameters = [],
        $relationshipParameters = []
    ) {
        $page   = $modelClass::parsePage($parameters);
        $filter = $modelClass::parseFilter($parameters);
        $sort   = $modelClass::parseSort($parameters);
        $fields = $modelClass::parseFields($parameters);

        $requestInclude = static::getRequestInclude($parameters, $modelClass);

        $data = $modelClass::get(
            $page,
            $filter,
            $sort,
            $fields,
            ...$primaryDataParameters
        );

        //Get included data
        $includedData = $modelClass::getIncludedData(
            $data,
            $requestInclude,
            $fields,
            $relationshipParameters
        );

        $meta = (object) [
            'page' => (
                $page === null
                ? $modelClass::getDefaultPage()
                : $page
            )
        ];

        return static::viewData(
            $data,
            (object) [
                'self' => $modelClass::getSelfLink()
            ],
            $meta,
            (empty($requestInclude) ? null : $includedData)
        );
    }
protected static function handleGET ( $ parameters , $ modelClass , $ primaryDataParameters = [ ] , $ relationshipParameters = [ ] ) { $ page = $ modelClass :: parsePage ( $ parameters ) ; $ filter = $ modelClass :: parseFilter ( $ parameters ) ; $ sort = $ modelClass :: parseSort ( $ parameters ) ; $ fields = $ modelClass :: parseFields ( $ parameters ) ; $ requestInclude = static :: getRequestInclude ( $ parameters , $ modelClass ) ; $ data = $ modelClass :: get ( $ page , $ filter , $ sort , $ fields , ... $ primaryDataParameters ) ; //Get included data $ includedData = $ modelClass :: getIncludedData ( $ data , $ requestInclude , $ fields , $ relationshipParameters ) ; $ meta = ( object ) [ 'page' => ( $ page === null ? $ modelClass :: getDefaultPage ( ) : $ page ) ] ; return static :: viewData ( $ data , ( object ) [ 'self' => $ modelClass :: getSelfLink ( ) ] , $ meta , ( empty ( $ requestInclude ) ? null : $ includedData ) ) ; }
handles GET requests
@param  object $parameters  Request parameters
@param  string $modelClass                      Resource's primary model class name
to be used
@param  array $primaryDataParameters           *[Optional]* Array with any
additional arguments that the primary data is requiring
@param  array $relationshipParameters [Optional] Array with any
additional argument primary data's relationships are requiring
@param  boolean $filterable                     *[Optional]* Default is
true, if true allows `filter` URI parameters to be parsed for filtering
@param  boolean $filterableJSON                 *[Optional]* Default is
false, if true allows `filter` URI parameters to be parsed for filtering
for JSON encoded fields
@param  boolean $sortable                       *[Optional]* Default is
true, if true allows sorting
@uses $modelClass::get method to fetch resource collection
@throws \Exception
@throws RequestException
@return boolean
@todo Force parsing of relationship data when included
handles GET requests