RakutenRws_Api_AppRakutenApi::execute PHP Метод

execute() публичный Метод

public execute ( $parameter )
    public function execute($parameter)
    {
        $url = $this->genUrl();
        if ($this->isRequiredAccessToken) {
            $parameter['access_token'] = $this->client->getAccessToken();
        } else {
            $parameter['applicationId'] = $this->client->getApplicationId();
        }
        if ($this->client->getAffiliateId()) {
            $parameter['affiliateId'] = $this->client->getAffiliateId();
        }
        unset($parameter['callback']);
        unset($parameter['format']);
        $client = $this->client->getHttpClient();
        $method = 'get';
        if (strtoupper($this->getMethod()) !== 'GET') {
            $method = 'post';
        }
        $response = $client->{$method}($url, $parameter);
        $appresponse = new RakutenRws_ApiResponse_AppRakutenResponse($this->getOperationName(), $response);
        if ($this->autoSetIterator && $appresponse->isOk()) {
            $data = $appresponse->getData();
            if (!isset($data[$this->arrayName])) {
                throw new RakutenRws_Exception();
            }
            $items = array();
            foreach ($data[$this->arrayName] as $item) {
                $items[] = $item[$this->entityName];
            }
            $appresponse->setIterator($items);
        }
        return $appresponse;
    }

Usage Example

 public function execute($parameter)
 {
     $appresponse = parent::execute($parameter);
     if ($appresponse->isOk()) {
         $data = $appresponse->getData();
         if (!isset($data['result'])) {
             throw new RakutenRws_Exception();
         }
         $appresponse->setIterator($data['result']);
     }
     return $appresponse;
 }
All Usage Examples Of RakutenRws_Api_AppRakutenApi::execute