Update API

This commit is contained in:
Romain Neutron
2012-05-21 17:04:26 +02:00
parent 9e61465c17
commit 053b6ae859
2 changed files with 15 additions and 15 deletions

View File

@@ -1926,9 +1926,9 @@ class API_V1_adapter extends API_V1_Abstract
{ {
$ret = array( $ret = array(
'id' => $databox_field->get_id(), 'id' => $databox_field->get_id(),
'namespace' => $databox_field->get_metadata_namespace(), 'namespace' => $databox_field->get_tag()->getGroupName(),
'source' => $databox_field->get_metadata_source(), 'source' => $databox_field->get_tag()->getTagname(),
'tagname' => $databox_field->get_metadata_tagname(), 'tagname' => $databox_field->get_tag()->getName(),
'name' => $databox_field->get_name(), 'name' => $databox_field->get_name(),
'separator' => $databox_field->get_separator(), 'separator' => $databox_field->get_separator(),
'thesaurus_branch' => $databox_field->get_tbranch(), 'thesaurus_branch' => $databox_field->get_tbranch(),

View File

@@ -295,33 +295,33 @@ class API_V1_result
switch ($code = (int) $code) { switch ($code = (int) $code) {
case 400: case 400:
$this->http_code = $code; $this->http_code = $code;
$this->error_message = self::ERROR_BAD_REQUEST; $this->error_type = self::ERROR_BAD_REQUEST;
$this->error_details = API_V1_exception_badrequest::get_details(); $this->error_message = API_V1_exception_badrequest::get_details();
break; break;
case 401: case 401:
$this->http_code = $code; $this->http_code = $code;
$this->error_message = self::ERROR_UNAUTHORIZED; $this->error_type = self::ERROR_UNAUTHORIZED;
$this->error_details = API_V1_exception_unauthorized::get_details(); $this->error_message = API_V1_exception_unauthorized::get_details();
break; break;
case 403: case 403:
$this->http_code = $code; $this->http_code = $code;
$this->error_message = self::ERROR_FORBIDDEN; $this->error_type = self::ERROR_FORBIDDEN;
$this->error_details = API_V1_exception_forbidden::get_details(); $this->error_message = API_V1_exception_forbidden::get_details();
break; break;
case 404: case 404:
$this->http_code = $code; $this->http_code = $code;
$this->error_message = self::ERROR_NOTFOUND; $this->error_type = self::ERROR_NOTFOUND;
$this->error_details = API_V1_exception_notfound::get_details(); $this->error_message = API_V1_exception_notfound::get_details();
break; break;
case 405: case 405:
$this->http_code = $code; $this->http_code = $code;
$this->error_message = self::ERROR_METHODNOTALLOWED; $this->error_type = self::ERROR_METHODNOTALLOWED;
$this->error_details = API_V1_exception_methodnotallowed::get_details(); $this->error_message = API_V1_exception_methodnotallowed::get_details();
break; break;
case 500: case 500:
$this->http_code = $code; $this->http_code = $code;
$this->error_message = self::ERROR_INTERNALSERVERERROR; $this->error_type = self::ERROR_INTERNALSERVERERROR;
$this->error_details = API_V1_exception_internalservererror::get_details(); $this->error_message = API_V1_exception_internalservererror::get_details();
break; break;
} }