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;
}