mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 03:53:13 +00:00
Phraseanet API bumps to 1.1
This commit is contained in:
@@ -25,7 +25,7 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $version = '1.0';
|
protected $version = '1.1';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Appbox where the API works
|
* Appbox where the API works
|
||||||
@@ -437,8 +437,19 @@ class API_V1_adapter extends API_V1_Abstract
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
$metadatas = $request->get('metadatas');
|
$metadatas = $request->get('metadatas');
|
||||||
|
|
||||||
if (!is_array($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);
|
$record->set_metadatas($metadatas);
|
||||||
$result->set_datas(array("metadatas" => $this->list_record_caption($record->get_caption())));
|
$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
|
* @todo ajouter une option pour avoir les values serialisées
|
||||||
* dans un cas multi
|
* dans un cas multi
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'meta_id' => $value->getId()
|
'meta_id' => $value->getId()
|
||||||
, 'meta_structure_id' => $field->get_meta_struct_id()
|
, 'meta_structure_id' => $field->get_meta_struct_id()
|
||||||
|
Reference in New Issue
Block a user