src/Entity/Configuration.php line 13

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ConfigurationRepository;
  4. use App\Trait\DateTrait;
  5. use DateTimeImmutable;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. #[ORM\Entity(repositoryClassConfigurationRepository::class)]
  10. class Configuration
  11. {
  12.     use DateTrait;
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column]
  18.     private array $facturation = [];
  19.     #[ORM\Column(nullabletrue)]
  20.     private array $theme = [];
  21.     #[ORM\OneToOne(inversedBy'configuration'cascade: ['persist''remove'])]
  22.     #[ORM\JoinColumn(nullablefalse)]
  23.     private ?Establishment $establishment null;
  24.     #[ORM\Column(options: ['default' => false])]
  25.     private ?bool $isSite false;
  26.     #[ORM\ManyToOne(cascade: ["persist"])]
  27.     #[ORM\JoinColumn(nullabletrue)]
  28.     #[Groups(['article:list'])]
  29.     private ?Attachment $authThumbnail null;
  30.     public function __construct()
  31.     {
  32.         if (is_null($this->createdAt)) $this->createdAt = new DateTimeImmutable();
  33.         $this->updatedAt = new DateTimeImmutable();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getFacturation(): array
  40.     {
  41.         return $this->facturation;
  42.     }
  43.     public function setFacturation(array $facturation): self
  44.     {
  45.         $this->facturation $facturation;
  46.         return $this;
  47.     }
  48.     public function getTheme(): array
  49.     {
  50.         return $this->theme;
  51.     }
  52.     public function setTheme(array $theme): self
  53.     {
  54.         $this->theme $theme;
  55.         return $this;
  56.     }
  57.     public function getEstablishment(): ?Establishment
  58.     {
  59.         return $this->establishment;
  60.     }
  61.     public function setEstablishment(Establishment $establishment): self
  62.     {
  63.         $this->establishment $establishment;
  64.         return $this;
  65.     }
  66.     public function isIsSite(): ?bool
  67.     {
  68.         return $this->isSite;
  69.     }
  70.     public function setIsSite(bool $isSite): static
  71.     {
  72.         $this->isSite $isSite;
  73.         return $this;
  74.     }
  75.     public function getAuthThumbnail(): ?Attachment
  76.     {
  77.         return $this->authThumbnail;
  78.     }
  79.     public function setAuthThumbnail(?Attachment $thumbnail): self
  80.     {
  81.         $this->authThumbnail $thumbnail;
  82.         return $this;
  83.     }
  84. }