vendor/crosiersource/crosierlib-base/src/Entity/Config/EntMenu.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\Common\Collections\ArrayCollection;
  13. use Doctrine\ORM\Mapping as ORM;
  14. use Symfony\Component\Serializer\Annotation\Groups;
  15. /**
  16.  * @ApiResource(
  17.  *     normalizationContext={"groups"={"entMenu","entityId"},"enable_max_depth"=true},
  18.  *     denormalizationContext={"groups"={"entMenu"},"enable_max_depth"=true},
  19.  *
  20.  *     itemOperations={
  21.  *          "get"={"path"="/cfg/entMenu/{id}"},
  22.  *          "put"={"path"="/cfg/entMenu/{id}", "security"="is_granted('ROLE_ADMIN')"},
  23.  *          "delete"={"path"="/cfg/entMenu/{id}", "security"="is_granted('ROLE_ADMIN')"}
  24.  *     },
  25.  *     collectionOperations={
  26.  *          "get"={"path"="/cfg/entMenu"},
  27.  *          "post"={"path"="/cfg/entMenu", "security"="is_granted('ROLE_ADMIN')"}
  28.  *     },
  29.  *
  30.  *     attributes={
  31.  *          "pagination_items_per_page"=10,
  32.  *          "formats"={"jsonld", "csv"={"text/csv"}}
  33.  *     }
  34.  * )
  35.  * @ApiFilter(PropertyFilter::class)
  36.  *
  37.  * @ApiFilter(SearchFilter::class, properties={"UUID": "exact", "label": "partial", "id": "exact"})
  38.  * @ApiFilter(OrderFilter::class, properties={"id", "label", "updated", "ordem"}, arguments={"orderParameterName"="order"})
  39.  *
  40.  * @EntityHandler(entityHandlerClass="CrosierSource\CrosierLibRadxBundle\EntityHandler\Config\EntMenuEntityHandler")
  41.  *
  42.  * @ORM\Entity(repositoryClass="CrosierSource\CrosierLibBaseBundle\Repository\Config\EntMenuRepository")
  43.  * @ORM\Table(name="cfg_entmenu")
  44.  * @author Carlos Eduardo Pauluk
  45.  */
  46. class EntMenu implements EntityId
  47. {
  48.     use EntityIdTrait;
  49.     /**
  50.      * @ORM\Column(name="uuid", type="string", nullable=false, length=36)
  51.      * @NotUppercase()
  52.      * @Groups("entity")
  53.      *
  54.      * @var string|null
  55.      */
  56.     public ?string $UUID null;
  57.     /**
  58.      * Necessário para poder montar a URL corretamente (pois o domínio do App pode variar por ambiente).
  59.      *
  60.      * @ORM\Column(name="app_uuid", type="string", nullable=false, length=36)
  61.      * @NotUppercase()
  62.      * @Groups("entity")
  63.      *
  64.      * @var string|null
  65.      */
  66.     public ?string $appUUID null;
  67.     /**
  68.      *
  69.      * @ORM\Column(name="label", type="string", nullable=false, length=255)
  70.      * @NotUppercase()
  71.      * @Groups("entity")
  72.      *
  73.      * @var string|null
  74.      */
  75.     public ?string $label null;
  76.     /**
  77.      *
  78.      * @ORM\Column(name="icon", type="string", nullable=true, length=50)
  79.      * @NotUppercase()
  80.      * @Groups("entity")
  81.      *
  82.      * @var string|null
  83.      */
  84.     public ?string $icon null;
  85.     /**
  86.      *
  87.      * @ORM\Column(name="tipo", type="string", nullable=false, length=50)
  88.      * @Groups("entity")
  89.      *
  90.      * @var string|null
  91.      */
  92.     public ?string $tipo null;
  93.     /**
  94.      *
  95.      * @ORM\Column(name="ordem", type="integer", nullable=true)
  96.      * @Groups("entity")
  97.      *
  98.      * @var int|null
  99.      */
  100.     public ?int $ordem null;
  101.     /**
  102.      *
  103.      * @ORM\Column(name="css_style", type="string", nullable=true, length=200)
  104.      * @NotUppercase()
  105.      * @Groups("entity")
  106.      *
  107.      * @var string|null
  108.      */
  109.     public ?string $cssStyle null;
  110.     /**
  111.      *
  112.      * @ORM\Column(name="roles", type="string", nullable=true, length=200)
  113.      * @Groups("entity")
  114.      *
  115.      * @var string|null
  116.      */
  117.     public ?string $roles null;
  118.     /**
  119.      *
  120.      * @ORM\Column(name="url", type="string", nullable=false, length=2000)
  121.      * @NotUppercase()
  122.      * @Groups("entity")
  123.      *
  124.      * @var string|null
  125.      */
  126.     public ?string $url null;
  127.     /**
  128.      * @var string
  129.      * @ORM\Column(name="pai_uuid", type="string", nullable=true, length=36)
  130.      * @NotUppercase()
  131.      * @Groups("entity")
  132.      *
  133.      * @var string|null
  134.      */
  135.     public ?string $paiUUID null;
  136.     /**
  137.      * TRANSIENT
  138.      * @var EntMenu|null
  139.      */
  140.     public ?EntMenu $pai null;
  141.     /**
  142.      * TRANSIENT
  143.      * @var EntMenu|null
  144.      */
  145.     public ?EntMenu $superPai null;
  146.     /**
  147.      * TRANSIENT
  148.      * @var null|EntMenu[]|ArrayCollection
  149.      */
  150.     public $filhos;
  151.     /**
  152.      * TRANSIENT.
  153.      * @var int
  154.      */
  155.     public $nivel;
  156.     /**
  157.      * TRANSIENT.
  158.      * @var string
  159.      */
  160.     public string $yaml;
  161.     public function __construct()
  162.     {
  163.         $this->filhos = new ArrayCollection();
  164.     }
  165. }