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

        $rest = new RestTool(true, $this->_root);
        $response = $rest->Request($urlMethod, $this->GetRequestType($methodKey));

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

        return $response;
    }
protected function GetObject($methodKey, $entityId, $responseClassName = null, $secondEntityId = null)
    {
        $urlMethod = sprintf($this->GetRequestUrl($methodKey), $entityId, $secondEntityId);

        $rest = new RestTool(true, $this->_root);
        $response = $rest->Request($urlMethod, $this->GetRequestType($methodKey));

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

        return $response;
    }
protected function GetObject ( $ methodKey , $ entityId , $ responseClassName = null , $ secondEntityId = null ) { $ urlMethod = sprintf ( $ this -> GetRequestUrl ( $ methodKey ) , $ entityId , $ secondEntityId ) ; $ rest = new RestTool ( true , $ this -> _root ) ; $ response = $ rest -> Request ( $ urlMethod , $ this -> GetRequestType ( $ methodKey ) ) ; if ( ! is_null ( $ responseClassName ) ) { return $ this -> CastResponseToEntity ( $ response , $ responseClassName ) ; } return $ response ; }
Get entity object from API
@param string $methodKey Key with request data
@param string $entityId Entity identifier
@param object $responseClassName Name of entity class from response
@param int $secondEntityId Entity identifier for second entity
@return object Response data
Get entity object from API