vendor/crosiersource/crosierlib-base/src/Entity/Base/Municipio.php line 42

Open in your IDE?
  1. <?php
  2. namespace CrosierSource\CrosierLibBaseBundle\Entity\Base;
  3. use ApiPlatform\Core\Annotation\ApiFilter;
  4. use ApiPlatform\Core\Annotation\ApiResource;
  5. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
  6. use CrosierSource\CrosierLibBaseBundle\Doctrine\Annotations\EntityHandler;
  7. use CrosierSource\CrosierLibBaseBundle\Entity\EntityId;
  8. use CrosierSource\CrosierLibBaseBundle\Entity\EntityIdTrait;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Component\Serializer\Annotation\Groups;
  11. /**
  12.  * @ApiResource(
  13.  *      normalizationContext={"groups"={"municipio","entityId"},"enable_max_depth"=true},
  14.  *      denormalizationContext={"groups"={"municipio"},"enable_max_depth"=true},
  15.  *
  16.  *      itemOperations={
  17.  *           "get"={"path"="/bse/municipio/{id}", "security"="is_granted('ROLE_ADMIN')"},
  18.  *           "put"={"path"="/bse/municipio/{id}", "security"="is_granted('ROLE_ADMIN')"},
  19.  *           "delete"={"path"="/bse/municipio/{id}", "security"="is_granted('ROLE_ADMIN')"}
  20.  *      },
  21.  *      collectionOperations={
  22.  *           "get"={"path"="/bse/municipio", "security"="is_granted('ROLE_ADMIN')"},
  23.  *           "post"={"path"="/bse/municipio", "security"="is_granted('ROLE_ADMIN')"}
  24.  *      },
  25.  *
  26.  *      attributes={
  27.  *           "pagination_items_per_page"=10,
  28.  *           "formats"={"jsonld", "csv"={"text/csv"}}
  29.  *      }
  30.  *  )
  31.  *
  32.  * @ApiFilter(OrderFilter::class, properties={"id", "UUID", "nome", "updated"}, arguments={"orderParameterName"="order"})
  33.  *
  34.  * @EntityHandler(entityHandlerClass="CrosierSource\CrosierLibBaseBundle\EntityHandler\Base\MunicipioEntityHandler")
  35.  * @ORM\Entity(repositoryClass="CrosierSource\CrosierLibBaseBundle\Repository\Base\MunicipioRepository")
  36.  * @ORM\Table(name="bse_municipio")
  37.  * @author Carlos Eduardo Pauluk
  38.  */
  39. class Municipio implements EntityId
  40. {
  41.     use EntityIdTrait;
  42.     /**
  43.      * @ORM\Column(name="municipio_codigo", type="integer", nullable=false)
  44.      * @Groups("municipio")
  45.      * @var null|int
  46.      */
  47.     public ?int $municipioCodigo null;
  48.     /**
  49.      * @ORM\Column(name="municipio_nome", type="string", nullable=true, length=200)
  50.      * @Groups("municipio")
  51.      * @var null|string
  52.      */
  53.     public ?string $municipioNome null;
  54.     /**
  55.      * @ORM\Column(name="uf_nome", type="string", nullable=true, length=200)
  56.      * @Groups("municipio")
  57.      * @var null|string
  58.      */
  59.     public ?string $ufNome null;
  60.     /**
  61.      * @ORM\Column(name="uf_sigla", type="string", nullable=true, length=2)
  62.      * @Groups("municipio")
  63.      * @var null|string
  64.      */
  65.     public ?string $ufSigla null;
  66. }