MangoPay/Libraries/ApiBase.php
protected function GetList($methodKey, & $pagination, $responseClassName = null, $entityId = null, $filter = null, $sorting = null, $secondEntityId = null)
    {
        $urlMethod = sprintf($this->GetRequestUrl($methodKey), $entityId, $secondEntityId);

        if (is_null($pagination) || !is_object($pagination) || get_class($pagination) != 'MangoPay\Pagination') {
            $pagination = new \MangoPay\Pagination();
        }

        $rest = new RestTool(true, $this->_root);
        $additionalUrlParams = array();
        if (!is_null($filter)) {
            $additionalUrlParams["filter"] = $filter;
        }
        if (!is_null($sorting)) {
            if (!is_a($sorting, "\MangoPay\Sorting")) {
                throw new Exception('Wrong type of sorting object');
            }

            $additionalUrlParams["sort"] = $sorting->GetSortParameter();
        }

        $response = $rest->Request($urlMethod, $this->GetRequestType($methodKey), null, null, $pagination, $additionalUrlParams);

        if (!is_null($responseClassName)) {
            return $this->CastResponseToEntity($response, $responseClassName);
        }

        return $response;
    }
protected function GetList($methodKey, & $pagination, $responseClassName = null, $entityId = null, $filter = null, $sorting = null, $secondEntityId = null)
    {
        $urlMethod = sprintf($this->GetRequestUrl($methodKey), $entityId, $secondEntityId);

        if (is_null($pagination) || !is_object($pagination) || get_class($pagination) != 'MangoPay\Pagination') {
            $pagination = new \MangoPay\Pagination();
        }

        $rest = new RestTool(true, $this->_root);
        $additionalUrlParams = array();
        if (!is_null($filter)) {
            $additionalUrlParams["filter"] = $filter;
        }
        if (!is_null($sorting)) {
            if (!is_a($sorting, "\MangoPay\Sorting")) {
                throw new Exception('Wrong type of sorting object');
            }

            $additionalUrlParams["sort"] = $sorting->GetSortParameter();
        }

        $response = $rest->Request($urlMethod, $this->GetRequestType($methodKey), null, null, $pagination, $additionalUrlParams);

        if (!is_null($responseClassName)) {
            return $this->CastResponseToEntity($response, $responseClassName);
        }

        return $response;
    }
protected function GetList ( $ methodKey , & $ pagination , $ responseClassName = null , $ entityId = null , $ filter = null , $ sorting = null , $ secondEntityId = null ) { $ urlMethod = sprintf ( $ this -> GetRequestUrl ( $ methodKey ) , $ entityId , $ secondEntityId ) ; if ( is_null ( $ pagination ) || ! is_object ( $ pagination ) || get_class ( $ pagination ) != 'MangoPay\Pagination' ) { $ pagination = new \ MangoPay \ Pagination ( ) ; } $ rest = new RestTool ( true , $ this -> _root ) ; $ additionalUrlParams = array ( ) ; if ( ! is_null ( $ filter ) ) { $ additionalUrlParams [ "filter" ] = $ filter ; } if ( ! is_null ( $ sorting ) ) { if ( ! is_a ( $ sorting , "\MangoPay\Sorting" ) ) { throw new Exception ( 'Wrong type of sorting object' ) ; } $ additionalUrlParams [ "sort" ] = $ sorting -> GetSortParameter ( ) ; } $ response = $ rest -> Request ( $ urlMethod , $ this -> GetRequestType ( $ methodKey ) , null , null , $ pagination , $ additionalUrlParams ) ; if ( ! is_null ( $ responseClassName ) ) { return $ this -> CastResponseToEntity ( $ response , $ responseClassName ) ; } return $ response ; }
Get lst with entities object from API
@param string $methodKey Key with request data
@param \MangoPay\Pagination $pagination Pagination object
@param object $responseClassName Name of entity class from response
@param string $entityId Entity identifier
@param object $filter Object to filter data
@param \MangoPay\Sorting $sorting Object to sorting data
@return object[] Response data
Get lst with entities object from API