mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 05:53:13 +00:00
Merge branch '3.6' of github.com:alchemy-fr/Phraseanet into 3.6
This commit is contained in:
@@ -76,17 +76,17 @@ class Bridge_Api_Apitest_Containers implements Bridge_Api_ContainerInterface
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function get_category()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function is_private()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function get_rating()
|
||||
{
|
||||
|
||||
@@ -174,8 +174,12 @@ class Bridge_Api_Apitest_Element implements Bridge_Api_ElementInterface
|
||||
|
||||
class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Interface
|
||||
{
|
||||
|
||||
const AUTH_TYPE = 'None';
|
||||
|
||||
public static $hasError = false;
|
||||
public static $hasException = false;
|
||||
|
||||
public function __construct(registryInterface $registry, Bridge_Api_Auth_Interface $auth)
|
||||
{
|
||||
parent::__construct($registry, $auth);
|
||||
@@ -384,19 +388,31 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
|
||||
}
|
||||
|
||||
public function create_container($container_type, Request $request)
|
||||
public function create_container($container_type, \Symfony\Component\HttpFoundation\Request $request)
|
||||
{
|
||||
|
||||
if (self::$hasException)
|
||||
{
|
||||
self::$hasException = false;
|
||||
throw new \Exception("une erreur");
|
||||
}
|
||||
}
|
||||
|
||||
public function add_element_to_container($element_type, $element_id, $destination, $container_id)
|
||||
{
|
||||
|
||||
if (self::$hasException)
|
||||
{
|
||||
self::$hasException = false;
|
||||
throw new \Exception("une erreur");
|
||||
}
|
||||
}
|
||||
|
||||
public function delete_object($object, $object_id)
|
||||
{
|
||||
|
||||
if (self::$hasException)
|
||||
{
|
||||
self::$hasException = false;
|
||||
throw new \Exception("une erreur");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -405,7 +421,11 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
*/
|
||||
public function acceptable_records()
|
||||
{
|
||||
|
||||
$func = function($record)
|
||||
{
|
||||
return true;
|
||||
};
|
||||
return $func;
|
||||
}
|
||||
|
||||
public function get_element_status(Bridge_Element $element)
|
||||
@@ -440,12 +460,17 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
|
||||
public function check_upload_constraints(array $datas, record_adapter $record)
|
||||
{
|
||||
|
||||
if (self::$hasError)
|
||||
{
|
||||
self::$hasError = false;
|
||||
return array('title' => 'too long');
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
public function get_upload_datas(Request $request, record_adapter $record)
|
||||
public function get_upload_datas(\Symfony\Component\HttpFoundation\Request $request, record_adapter $record)
|
||||
{
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
public function is_multiple_upload()
|
||||
@@ -455,12 +480,26 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
|
||||
public function check_update_constraints(Array $datas)
|
||||
{
|
||||
|
||||
if (!self::$hasError)
|
||||
{
|
||||
if (self::$hasException)
|
||||
{
|
||||
self::$hasException = false;
|
||||
throw new \Exception('une erreur');
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
elseif (self::$hasError)
|
||||
{
|
||||
self::$hasError = false;
|
||||
return array('title' => 'too long');
|
||||
}
|
||||
}
|
||||
|
||||
public function get_update_datas(Request $request)
|
||||
public function get_update_datas(\Symfony\Component\HttpFoundation\Request $request)
|
||||
{
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user