|
|
@@ -0,0 +1,152 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+declare(strict_types=1);
|
|
|
+
|
|
|
+namespace App\Entity\Access;
|
|
|
+
|
|
|
+use ApiPlatform\Core\Annotation\ApiResource;
|
|
|
+use App\Repository\Access\PersonalizedListRepository;
|
|
|
+use Doctrine\ORM\Mapping as ORM;
|
|
|
+use Symfony\Component\Serializer\Annotation\Groups;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Liste personnalisées
|
|
|
+ *
|
|
|
+ * @ApiResource(
|
|
|
+ * attributes={"pagination_enabled"=false},
|
|
|
+ * collectionOperations={
|
|
|
+ * "get"={"normalization_context"={"groups"={"lists:output"}}}
|
|
|
+ * },
|
|
|
+ * itemOperations={
|
|
|
+ * "get"={"security"="object.getAccess().getId() == user.getId()"}
|
|
|
+ * }
|
|
|
+ * )
|
|
|
+ * @ORM\Entity(repositoryClass=PersonalizedListRepository::class)
|
|
|
+ */
|
|
|
+class PersonalizedList
|
|
|
+{
|
|
|
+ /**
|
|
|
+ * @ORM\Id
|
|
|
+ * @ORM\GeneratedValue
|
|
|
+ * @ORM\Column(type="integer")
|
|
|
+ * @Groups({"lists:output"})
|
|
|
+ */
|
|
|
+ private $id;
|
|
|
+ /**
|
|
|
+ * @ORM\ManyToOne(targetEntity="Access", inversedBy="personalizedLists")
|
|
|
+ * @ORM\JoinColumn(nullable=false)
|
|
|
+ */
|
|
|
+ private $access;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Column(type="string", length=200, nullable=true)
|
|
|
+ * @Groups({"lists:output"})
|
|
|
+ */
|
|
|
+ private $label;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Column(type="json_array", length=4294967295, nullable=true)
|
|
|
+ */
|
|
|
+ private $filters;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Column(type="string", length=150)
|
|
|
+ * @Groups({"lists:output"})
|
|
|
+ */
|
|
|
+ private $entity;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Column(type="json_array", nullable=true)
|
|
|
+ */
|
|
|
+ private $columns;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Column(type="string", length=150, nullable=true)
|
|
|
+ * @Groups({"lists:output"})
|
|
|
+ */
|
|
|
+ private $menuKey;
|
|
|
+
|
|
|
+ public function __construct()
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getId(): ?int
|
|
|
+ {
|
|
|
+ return $this->id;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function setFilters(array $filters):self
|
|
|
+ {
|
|
|
+ $this->filters = $filters;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getFilters(): ?array
|
|
|
+ {
|
|
|
+ return $this->filters;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function setColumns(array $columns):self
|
|
|
+ {
|
|
|
+ $this->columns = $columns;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getColumns(): ?array
|
|
|
+ {
|
|
|
+ return $this->columns;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function setAccess(Access $access):self
|
|
|
+ {
|
|
|
+ $this->access = $access;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getAccess(): Access
|
|
|
+ {
|
|
|
+ return $this->access;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function setMenuKey(string $menuKey):self
|
|
|
+ {
|
|
|
+ $this->menuKey = $menuKey;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getMenuKey(): ?string
|
|
|
+ {
|
|
|
+ return $this->menuKey;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function setLabel(string $label):self
|
|
|
+ {
|
|
|
+ $this->label = $label;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getLabel(): ?string
|
|
|
+ {
|
|
|
+ return $this->label;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function setEntity(string $entity):self
|
|
|
+ {
|
|
|
+ $this->entity = $entity;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getEntity(): ?string
|
|
|
+ {
|
|
|
+ return $this->entity;
|
|
|
+ }
|
|
|
+}
|