vendor/crosiersource/crosierlib-radx/src/Entity/Financeiro/BandeiraCartao.php line 52

Open in your IDE?
  1. <?php
  2. namespace CrosierSource\CrosierLibRadxBundle\Entity\Financeiro;
  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\Entity\EntityId;
  10. use CrosierSource\CrosierLibBaseBundle\Entity\EntityIdTrait;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Symfony\Component\Serializer\Annotation\Groups;
  13. /**
  14.  * Entidade Bandeira de Cartão.
  15.  * Ex.: MASTER MAESTRO, MASTER, VISA ELECTRON, VISA, etc.
  16.  *
  17.  * @ApiResource(
  18.  *     normalizationContext={"groups"={"bandeiraCartao","modo","entityId"},"enable_max_depth"=true},
  19.  *     denormalizationContext={"groups"={"bandeiraCartao"},"enable_max_depth"=true},
  20.  *
  21.  *     itemOperations={
  22.  *          "get"={"path"="/fin/bandeiraCartao/{id}", "security"="is_granted('ROLE_FINAN')"},
  23.  *          "put"={"path"="/fin/bandeiraCartao/{id}", "security"="is_granted('ROLE_FINAN_MASTER')"},
  24.  *          "delete"={"path"="/fin/bandeiraCartao/{id}", "security"="is_granted('ROLE_FINAN_MASTER')"}
  25.  *     },
  26.  *     collectionOperations={
  27.  *          "get"={"path"="/fin/bandeiraCartao", "security"="is_granted('ROLE_FINAN')"},
  28.  *          "post"={"path"="/fin/bandeiraCartao", "security"="is_granted('ROLE_FINAN_MASTER')"}
  29.  *     },
  30.  *
  31.  *     attributes={
  32.  *          "pagination_items_per_page"=10,
  33.  *          "formats"={"jsonld", "csv"={"text/csv"}}
  34.  *     }
  35.  *
  36.  * )
  37.  * @ApiFilter(PropertyFilter::class)
  38.  *
  39.  * @ApiFilter(SearchFilter::class, properties={"descricao": "partial", "id": "exact", "modo": "exact"})
  40.  * @ApiFilter(OrderFilter::class, properties={"id", "descricao", "updated"}, arguments={"orderParameterName"="order"})
  41.  *
  42.  * @EntityHandler(entityHandlerClass="CrosierSource\CrosierLibRadxBundle\EntityHandler\Financeiro\BandeiraCartaoEntityHandler")
  43.  *
  44.  * @ORM\Entity(repositoryClass="CrosierSource\CrosierLibRadxBundle\Repository\Financeiro\BandeiraCartaoRepository")
  45.  * @ORM\Table(name="fin_bandeira_cartao")
  46.  *
  47.  * @author Carlos Eduardo Pauluk
  48.  */
  49. class BandeiraCartao implements EntityId
  50. {
  51.     use EntityIdTrait;
  52.     /**
  53.      *
  54.      * @ORM\Column(name="descricao", type="string")
  55.      * @Groups("bandeiraCartao")
  56.      */
  57.     public ?string $descricao null;
  58.     /**
  59.      *
  60.      * @ORM\ManyToOne(targetEntity="CrosierSource\CrosierLibRadxBundle\Entity\Financeiro\Modo")
  61.      * @ORM\JoinColumn(nullable=false)
  62.      * @Groups("bandeiraCartao")
  63.      */
  64.     public ?Modo $modo null;
  65.     /**
  66.      * Para marcar diferentes nomes que podem ser utilizados para definir uma bandeira (ex.: MAESTRO ou MASTER MAESTRO ou M MAESTRO).
  67.      *
  68.      * @ORM\Column(name="labels", type="string")
  69.      * @Groups("bandeiraCartao")
  70.      */
  71.     public ?string $labels null;
  72. }