vendor/crosiersource/crosierlib-base/src/Entity/Config/Estabelecimento.php line 49

Open in your IDE?
  1. <?php
  2. namespace CrosierSource\CrosierLibBaseBundle\Entity\Config;
  3. use ApiPlatform\Core\Annotation\ApiFilter;
  4. use ApiPlatform\Core\Annotation\ApiResource;
  5. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
  6. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  7. use ApiPlatform\Core\Serializer\Filter\PropertyFilter;
  8. use CrosierSource\CrosierLibBaseBundle\Doctrine\Annotations\EntityHandler;
  9. use CrosierSource\CrosierLibBaseBundle\Doctrine\Annotations\NotUppercase;
  10. use CrosierSource\CrosierLibBaseBundle\Entity\EntityId;
  11. use CrosierSource\CrosierLibBaseBundle\Entity\EntityIdTrait;
  12. use Doctrine\ORM\Mapping as ORM;
  13. use Symfony\Component\Serializer\Annotation\Groups;
  14. /**
  15.  * Entidade 'Estabelecimento'.
  16.  *
  17.  * @ApiResource(
  18.  *     normalizationContext={"groups"={"estabelecimento","entityId"},"enable_max_depth"=true},
  19.  *     denormalizationContext={"groups"={"estabelecimento"},"enable_max_depth"=true},
  20.  *
  21.  *     itemOperations={
  22.  *          "get"={"path"="/cfg/estabelecimento/{id}", "security"="is_granted('IS_AUTHENTICATED_REMEMBERED')"},
  23.  *          "put"={"path"="/cfg/estabelecimento/{id}", "security"="is_granted('ROLE_ADMIN')"},
  24.  *          "delete"={"path"="/cfg/estabelecimento/{id}", "security"="is_granted('ROLE_ADMIN')"}
  25.  *     },
  26.  *     collectionOperations={
  27.  *          "get"={"path"="/cfg/estabelecimento", "security"="is_granted('IS_AUTHENTICATED_REMEMBERED')"},
  28.  *          "post"={"path"="/cfg/estabelecimento", "security"="is_granted('ROLE_ADMIN')"}
  29.  *     },
  30.  *
  31.  *     attributes={
  32.  *          "pagination_items_per_page"=10,
  33.  *          "formats"={"jsonld", "csv"={"text/csv"}}
  34.  *     }
  35.  * )
  36.  * @ApiFilter(PropertyFilter::class)
  37.  *
  38.  * @ApiFilter(SearchFilter::class, properties={"codigo": "exact", "descricao": "partial", "id": "exact"})
  39.  * @ApiFilter(OrderFilter::class, properties={"id", "codigo", "descricao", "updated"}, arguments={"orderParameterName"="order"})
  40.  *
  41.  * @EntityHandler(entityHandlerClass="CrosierSource\CrosierLibBaseBundle\EntityHandler\Config\EstabelecimentoEntityHandler")
  42.  *
  43.  * @ORM\Entity(repositoryClass="CrosierSource\CrosierLibBaseBundle\Repository\Config\EstabelecimentoRepository")
  44.  * @ORM\Table(name="cfg_estabelecimento")
  45.  */
  46. class Estabelecimento implements EntityId
  47. {
  48.     use EntityIdTrait;
  49.     /**
  50.      *
  51.      * @ORM\Column(name="codigo", type="integer", nullable=false)
  52.      * @Groups("estabelecimento")
  53.      * @var null|int
  54.      */
  55.     public ?int $codigo null;
  56.     /**
  57.      *
  58.      * @ORM\Column(name="descricao", type="string", nullable=true, length=40)
  59.      * @Groups("estabelecimento")
  60.      * @var null|string
  61.      */
  62.     public ?string $descricao null;
  63.     /**
  64.      *
  65.      * @ORM\Column(name="concreto", type="boolean", nullable=false)
  66.      * @Groups("estabelecimento")
  67.      * @var null|bool
  68.      */
  69.     public ?bool $concreto false;
  70.     /**
  71.      * @ORM\Column(name="json_data", type="json")
  72.      * @NotUppercase
  73.      * @Groups("estabelecimento_jsonData")
  74.      */
  75.     public ?array $jsonData null;
  76. }