| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <?php
- declare(strict_types=1);
- namespace App\Entity\Organization;
- use ApiPlatform\Core\Annotation\ApiResource;
- use App\Repository\Organization\SettingsRepository;
- use Doctrine\ORM\Mapping as ORM;
- use Symfony\Component\Validator\Constraints as Assert;
- /**
- * Caractéristiques d'une Organization (produits, options...etc)
- */
- #[ApiResource]
- #[ORM\Entity(repositoryClass: SettingsRepository::class)]
- class Settings
- {
- #[ORM\Id]
- #[ORM\Column]
- #[ORM\GeneratedValue]
- private ?int $id = null;
- #[ORM\OneToOne(inversedBy: 'settings', cascade: ['persist', 'remove'])]
- #[ORM\JoinColumn(nullable: false)]
- private ?Organization $organization = null;
- #[ORM\Column(length: 255)]
- #[Assert\Choice(callback: ['\App\Enum\Organization\SettingsProductEnum', 'toArray'], message: 'invalid-product')]
- private string $product;
- #[ORM\Column(type: 'json', length: 4294967295, nullable: true)]
- private ?array $modules = [];
- #[ORM\Column(type: 'json', length: 4294967295, nullable: true)]
- private ?array $actions = [];
- #[ORM\Column(length: 255, options: ['default' => 'FRANCE'])]
- private string $country;
- public function getId(): ?int
- {
- return $this->id;
- }
- public function getOrganization(): ?Organization
- {
- return $this->organization;
- }
- public function setOrganization(Organization $organization): self
- {
- $this->organization = $organization;
- return $this;
- }
- public function getProduct(): string
- {
- return $this->product;
- }
- public function setProduct(string $product): self
- {
- $this->product = $product;
- return $this;
- }
- public function getModules(): ?array
- {
- return $this->modules;
- }
- public function setModules(?array $modules): self
- {
- $this->modules = $modules;
- return $this;
- }
- public function getActions(): ?array
- {
- return $this->actions;
- }
- public function setActions(?array $actions): self
- {
- $this->actions = $actions;
- return $this;
- }
- public function getCountry(): string
- {
- return $this->country;
- }
- public function setCountry(string $country): self
- {
- $this->country = $country;
- return $this;
- }
- }
|