Phraseanet API bumps to 1.1

This commit is contained in:
Romain Neutron
2012-02-10 17:44:19 +01:00
parent f7d872819c
commit d0d8735e4f

View File

@@ -25,7 +25,7 @@ class API_V1_adapter extends API_V1_Abstract
*
* @var string
*/
protected $version = '1.0';
protected $version = '1.1';
/**
* Appbox where the API works
@@ -437,8 +437,19 @@ class API_V1_adapter extends API_V1_Abstract
try
{
$metadatas = $request->get('metadatas');
if (!is_array($metadatas))
throw new Exception();
{
throw new Exception('Metadatas should be an array');
}
foreach ($metadatas as $metadata)
{
if (!is_array($metadata))
{
throw new Exception('Each Metadata value should be an array');
}
}
$record->set_metadatas($metadatas);
$result->set_datas(array("metadatas" => $this->list_record_caption($record->get_caption())));
@@ -1101,7 +1112,6 @@ class API_V1_adapter extends API_V1_Abstract
* @todo ajouter une option pour avoir les values serialisées
* dans un cas multi
*/
return array(
'meta_id' => $value->getId()
, 'meta_structure_id' => $field->get_meta_struct_id()