Files
Phraseanet/lib/Alchemy/Phrasea/Controller/Api/LazaretController.php
Jean-Yves Gaulier 1f32977b0e #PHRAS-947 time 1d
first commit
new routes
DELETE /api/v2/quarantine/item/{{item_id}}/
POST /api/v2/quarantine/item/{{item_id}}/add
2016-02-22 18:06:02 +01:00

45 lines
1.2 KiB
PHP

<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2016 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Controller\Api;
use Alchemy\Phrasea\Controller\Controller;
use Alchemy\Phrasea\Model\Manipulator\LazaretManipulator;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class LazaretController extends Controller
{
/**
* @param int $lazaret_id
* @param Request $request
* @return Response
*/
public function quarantineItemDeleteAction(Request $request, $lazaret_id)
{
/** @var LazaretManipulator $lazaretManipulator */
$lazaretManipulator = $this->app['manipulator.lazaret'];
$ret = $lazaretManipulator->deny($lazaret_id);
return Result::create($request, $ret)->createResponse();
}
public function quarantineItemAddAction(Request $request, $lazaret_id)
{
/** @var LazaretManipulator $lazaretManipulator */
$lazaretManipulator = $this->app['manipulator.lazaret'];
$ret = $lazaretManipulator->add($lazaret_id);
return Result::create($request, $ret)->createResponse();
}
}