mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
32 lines
900 B
PHP
32 lines
900 B
PHP
<?php
|
|
|
|
/**
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Chill\PersonBundle\Controller;
|
|
|
|
use Chill\MainBundle\CRUD\Controller\ApiController;
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
|
|
class AccompanyingCourseWorkApiController extends ApiController
|
|
{
|
|
protected function getContextForSerialization(string $action, Request $request, string $_format, $entity): array
|
|
{
|
|
switch ($action) {
|
|
case '_entity':
|
|
switch ($request->getMethod()) {
|
|
case Request::METHOD_PUT:
|
|
return ['groups' => ['accompanying_period_work:edit']];
|
|
}
|
|
}
|
|
|
|
return parent::getContextForSerialization($action, $request, $_format, $entity);
|
|
}
|
|
}
|