src/App/Controller/Api/CubagePrestationEstimedController.php line 40

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Api;
  3. use App\Controller\AbstractController;
  4. use App\Entity\CubagePrestationEstimed;
  5. use App\Model\Enum\AccessControl;
  6. use App\Traits\Autowired\Manager\CubagePrestationEstimedManagerTrait;
  7. use GollumSF\RestBundle\Annotation\Serialize;
  8. use GollumSF\RestBundle\Annotation\Unserialize;
  9. use GollumSF\RestBundle\Annotation\Validate;
  10. use GollumSF\RestDocBundle\Annotation\ApiDescribe;
  11. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  12. use Symfony\Component\Routing\Annotation\Route;
  13. /**
  14.  * @Route("/api/cubage-prestation-estimeds")
  15.  * @ApiDescribe(CubagePrestationEstimed::class)
  16.  */
  17. class CubagePrestationEstimedController extends AbstractController {
  18.     
  19.     use CubagePrestationEstimedManagerTrait;
  20.     
  21.     /**
  22.      * @Route("", methods="GET", requirements={"prestationEstimed"="\d+"})
  23.      * @IsGranted(AccessControl::API_GET_CUBAGEPRESTATIONESTIMED, subject="current_user")
  24.      * @Serialize(groups="cubagePrestationEstimed_getc")
  25.      * @ApiDescribe(
  26.      *     request={
  27.      *         "parameters"={
  28.      *             "filters"={
  29.      *                 "in"="query",
  30.      *                 "required"=false,
  31.      *                 "type"="string",
  32.      *                 "example"="{""prestation"":[],""boisType"":[],""boisQuality"":[],""boisSize"":[],""marquage"":[],""volumeInner"":{""min"":0,""max"":0},""volumeOutter"":{""min"":0,""max"":0},""coef"":{""min"":0,""max"":0}}"
  33.      *             }
  34.      *         }
  35.      *     }
  36.      * )
  37.      */
  38.     public function list() {
  39.         return $this->cubagePrestationEstimedManager->apiFindBy();
  40.     }
  41.     
  42.     /**
  43.      * @Route("/{id}", methods="GET", requirements={"id"="\d+"})
  44.      * @IsGranted(AccessControl::API_GET_CUBAGEPRESTATIONESTIMED, subject="current_user")
  45.      * @Serialize(groups="cubagePrestationEstimed_get")
  46.      */
  47.     public function find(CubagePrestationEstimed $cubagePrestationEstimed) {
  48.         return $cubagePrestationEstimed;
  49.     }
  50.     
  51.     /**
  52.      * @Route("", methods="POST")
  53.      * @IsGranted(AccessControl::API_POST_CUBAGEPRESTATIONESTIMED, subject="current_user")
  54.      * @Unserialize("cubagePrestationEstimed", groups="cubagePrestationEstimed_post")
  55.      * @Validate({ "cubagePrestationEstimed_post" })
  56.      * @Serialize(groups="cubagePrestationEstimed_get")
  57.      *
  58.      */
  59.     public function post(CubagePrestationEstimed $cubagePrestationEstimed) {
  60.         return $cubagePrestationEstimed;
  61.     }
  62.     /**
  63.      * @Route("/{id}", methods="PUT", requirements={"id"="\d+"})
  64.      * @IsGranted(AccessControl::API_PUT_CUBAGEPRESTATIONESTIMED, subject="current_user")
  65.      * @Unserialize("cubagePrestationEstimed", groups="cubagePrestationEstimed_put")
  66.      * @Validate({ "cubagePrestationEstimed_put" })
  67.      * @Serialize(groups="cubagePrestationEstimed_get")
  68.      *
  69.      */
  70.     public function put(CubagePrestationEstimed $cubagePrestationEstimed) {
  71.         return $cubagePrestationEstimed;
  72.     }
  73.     /**
  74.      * @Route("/{id}", methods="DELETE", requirements={"id"="\d+"})
  75.      * @IsGranted(AccessControl::API_DELETE_CUBAGEPRESTATIONESTIMED, subject="current_user")
  76.      * @Serialize(groups="cubagePrestationEstimed_get")
  77.      *
  78.      */
  79.     public function delete(CubagePrestationEstimed $cubagePrestationEstimed) {
  80.         return $this->cubagePrestationEstimedManager->delete($cubagePrestationEstimed);
  81.     }
  82. }