| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <?php
- declare (strict_types=1);
- namespace App\Entity\Access;
- use ApiPlatform\Metadata\GetCollection;
- use ApiPlatform\Metadata\Get;
- use ApiPlatform\Metadata\ApiResource;
- use App\Repository\Access\PersonalizedListRepository;
- use Doctrine\ORM\Mapping as ORM;
- use JetBrains\PhpStorm\Pure;
- use Symfony\Component\Serializer\Annotation\Groups;
- /**
- * Liste personnalisées
- */
- #[ApiResource(
- operations: [
- new Get(
- security: 'object.getAccess().getId() == user.getId()'
- ),
- new GetCollection(
- normalizationContext: ['groups' => ['lists:output']]
- )
- ],
- paginationEnabled: false
- )]
- #[ORM\Entity(repositoryClass: PersonalizedListRepository::class)]
- class PersonalizedList
- {
- #[ORM\Id]
- #[ORM\Column]
- #[ORM\GeneratedValue]
- #[Groups(['lists:output'])]
- private ?int $id = null;
- #[ORM\ManyToOne(inversedBy: 'personalizedLists')]
- #[ORM\JoinColumn(nullable: false)]
- private ?Access $access = null;
- #[ORM\Column(length: 200, nullable: true)]
- #[Groups(['lists:output'])]
- private ?string $label = null;
- #[ORM\Column(length: 4294967295, nullable: true)]
- private ?array $filters = null;
- #[ORM\Column(length: 150)]
- #[Groups(['lists:output'])]
- private string $entity;
- #[ORM\Column(length: 4294967295, nullable: true)]
- private array $columns;
- #[ORM\Column(length: 150, nullable: true)]
- #[Groups(['lists:output'])]
- private string $menuKey;
- #[Pure]
- 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;
- }
- }
|