vendor/crosiersource/crosierlib-base/src/Entity/Config/App.php line 45

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 CrosierSource\CrosierLibBaseBundle\Doctrine\Annotations\EntityHandler;
  7. use CrosierSource\CrosierLibBaseBundle\Doctrine\Annotations\NotUppercase;
  8. use CrosierSource\CrosierLibBaseBundle\Entity\EntityId;
  9. use CrosierSource\CrosierLibBaseBundle\Entity\EntityIdTrait;
  10. use Doctrine\Common\Collections\ArrayCollection;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Symfony\Component\Serializer\Annotation\Groups;
  13. /**
  14.  * @ApiResource(
  15.  *     normalizationContext={"groups"={"app","entityId"},"enable_max_depth"=true},
  16.  *     denormalizationContext={"groups"={"app"},"enable_max_depth"=true},
  17.  *
  18.  *     itemOperations={
  19.  *          "get"={"path"="/cfg/app/{id}", "security"="is_granted('ROLE_ADMIN')"},
  20.  *          "put"={"path"="/cfg/app/{id}", "security"="is_granted('ROLE_ADMIN')"},
  21.  *          "delete"={"path"="/cfg/app/{id}", "security"="is_granted('ROLE_ADMIN')"}
  22.  *     },
  23.  *     collectionOperations={
  24.  *          "get"={"path"="/cfg/app", "security"="is_granted('ROLE_ADMIN')"},
  25.  *          "post"={"path"="/cfg/app", "security"="is_granted('ROLE_ADMIN')"}
  26.  *     },
  27.  *
  28.  *     attributes={
  29.  *          "pagination_items_per_page"=10,
  30.  *          "formats"={"jsonld", "csv"={"text/csv"}}
  31.  *     }
  32.  * )
  33.  *
  34.  * @ApiFilter(OrderFilter::class, properties={"id", "UUID", "nome", "updated"}, arguments={"orderParameterName"="order"})
  35.  *
  36.  * @EntityHandler(entityHandlerClass="CrosierSource\CrosierLibBaseBundle\EntityHandler\Config\AppEntityHandler")
  37.  * @ORM\Entity(repositoryClass="CrosierSource\CrosierLibBaseBundle\Repository\Config\AppRepository")
  38.  * @ORM\Table(name="cfg_app")
  39.  *
  40.  * @author Carlos Eduardo Pauluk
  41.  */
  42. class App implements EntityId
  43. {
  44.     use EntityIdTrait;
  45.     /**
  46.      * @ORM\Column(name="uuid", type="string", nullable=false, length=36)
  47.      * @NotUppercase()
  48.      * @Groups("app")
  49.      *
  50.      * @var null|string
  51.      */
  52.     public ?string $UUID null;
  53.     /**
  54.      *
  55.      * @ORM\Column(name="nome", type="string", nullable=true, length=300)
  56.      * @NotUppercase()
  57.      * @Groups("app")
  58.      *
  59.      * @var string|null
  60.      */
  61.     public ?string $nome null;
  62.     /**
  63.      *
  64.      * @ORM\Column(name="obs", type="string", nullable=true, length=5000)
  65.      * @Groups("app")
  66.      *
  67.      * @var string|null
  68.      */
  69.     public ?string $obs null;
  70.     /**
  71.      * Transient.
  72.      *
  73.      * @var array|null
  74.      */
  75.     public $configs;
  76.     public function __construct()
  77.     {
  78.         $this->configs = new ArrayCollection();
  79.     }
  80. }