<?php
namespace App\Controller\Api;
use App\Controller\AbstractController;
use App\Entity\CubagePrestationEstimed;
use App\Model\Enum\AccessControl;
use App\Traits\Autowired\Manager\CubagePrestationEstimedManagerTrait;
use GollumSF\RestBundle\Annotation\Serialize;
use GollumSF\RestBundle\Annotation\Unserialize;
use GollumSF\RestBundle\Annotation\Validate;
use GollumSF\RestDocBundle\Annotation\ApiDescribe;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
use Symfony\Component\Routing\Annotation\Route;
/**
* @Route("/api/cubage-prestation-estimeds")
* @ApiDescribe(CubagePrestationEstimed::class)
*/
class CubagePrestationEstimedController extends AbstractController {
use CubagePrestationEstimedManagerTrait;
/**
* @Route("", methods="GET", requirements={"prestationEstimed"="\d+"})
* @IsGranted(AccessControl::API_GET_CUBAGEPRESTATIONESTIMED, subject="current_user")
* @Serialize(groups="cubagePrestationEstimed_getc")
* @ApiDescribe(
* request={
* "parameters"={
* "filters"={
* "in"="query",
* "required"=false,
* "type"="string",
* "example"="{""prestation"":[],""boisType"":[],""boisQuality"":[],""boisSize"":[],""marquage"":[],""volumeInner"":{""min"":0,""max"":0},""volumeOutter"":{""min"":0,""max"":0},""coef"":{""min"":0,""max"":0}}"
* }
* }
* }
* )
*/
public function list() {
return $this->cubagePrestationEstimedManager->apiFindBy();
}
/**
* @Route("/{id}", methods="GET", requirements={"id"="\d+"})
* @IsGranted(AccessControl::API_GET_CUBAGEPRESTATIONESTIMED, subject="current_user")
* @Serialize(groups="cubagePrestationEstimed_get")
*/
public function find(CubagePrestationEstimed $cubagePrestationEstimed) {
return $cubagePrestationEstimed;
}
/**
* @Route("", methods="POST")
* @IsGranted(AccessControl::API_POST_CUBAGEPRESTATIONESTIMED, subject="current_user")
* @Unserialize("cubagePrestationEstimed", groups="cubagePrestationEstimed_post")
* @Validate({ "cubagePrestationEstimed_post" })
* @Serialize(groups="cubagePrestationEstimed_get")
*
*/
public function post(CubagePrestationEstimed $cubagePrestationEstimed) {
return $cubagePrestationEstimed;
}
/**
* @Route("/{id}", methods="PUT", requirements={"id"="\d+"})
* @IsGranted(AccessControl::API_PUT_CUBAGEPRESTATIONESTIMED, subject="current_user")
* @Unserialize("cubagePrestationEstimed", groups="cubagePrestationEstimed_put")
* @Validate({ "cubagePrestationEstimed_put" })
* @Serialize(groups="cubagePrestationEstimed_get")
*
*/
public function put(CubagePrestationEstimed $cubagePrestationEstimed) {
return $cubagePrestationEstimed;
}
/**
* @Route("/{id}", methods="DELETE", requirements={"id"="\d+"})
* @IsGranted(AccessControl::API_DELETE_CUBAGEPRESTATIONESTIMED, subject="current_user")
* @Serialize(groups="cubagePrestationEstimed_get")
*
*/
public function delete(CubagePrestationEstimed $cubagePrestationEstimed) {
return $this->cubagePrestationEstimedManager->delete($cubagePrestationEstimed);
}
}