chill-bundles/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php

24 lines
697 B
PHP

<?php
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);
}
}