src/Entity/Crm/CrmSettings.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Crm;
  3. use App\Entity\Adherent\Magasin;
  4. use App\Repository\Crm\CrmSettingsRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Doctrine\ORM\Mapping\PrePersist;
  7. #[ORM\Entity(repositoryClassCrmSettingsRepository::class)]
  8. #[ORM\hasLifecycleCallbacks]
  9. class CrmSettings
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column]
  16.     private ?bool $activeIa false;
  17.     #[ORM\Column]
  18.     private ?bool $autoPublish false;
  19.     #[ORM\Column(nullabletrue)]
  20.     private ?\DateTimeImmutable $createdAt null;
  21.     #[ORM\Column(nullabletrue)]
  22.     private ?\DateTimeImmutable $updatedAt null;
  23.     #[ORM\OneToOne(inversedBy'crmSettings'cascade: ['persist''remove'])]
  24.     #[ORM\JoinColumn(name'magasin'referencedColumnName'k_adherent')]
  25.     private ?Magasin $magasin null;
  26.     public function __construct()
  27.     {
  28.         $this->createdAt = new \DateTimeImmutable();
  29.     }
  30.     #[ORM\PreUpdate]
  31.     public function onPreUpdateEntity(): void
  32.     {
  33.         $this->updatedAt = new \DateTimeImmutable();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function isActiveIa(): ?bool
  40.     {
  41.         return $this->activeIa;
  42.     }
  43.     public function setActiveIa(bool $activeIa): static
  44.     {
  45.         $this->activeIa $activeIa;
  46.         return $this;
  47.     }
  48.     public function getCreatedAt(): ?\DateTimeImmutable
  49.     {
  50.         return $this->createdAt;
  51.     }
  52.     public function setCreatedAt(?\DateTimeImmutable $createdAt): static
  53.     {
  54.         $this->createdAt $createdAt;
  55.         return $this;
  56.     }
  57.     public function getUpdatedAt(): ?\DateTimeImmutable
  58.     {
  59.         return $this->updatedAt;
  60.     }
  61.     public function setUpdatedAt(?\DateTimeImmutable $updatedAt): static
  62.     {
  63.         $this->updatedAt $updatedAt;
  64.         return $this;
  65.     }
  66.     public function getMagasin(): ?Magasin
  67.     {
  68.         return $this->magasin;
  69.     }
  70.     public function setMagasin(?Magasin $magasin): static
  71.     {
  72.         $this->magasin $magasin;
  73.         return $this;
  74.     }
  75.     public function getAutoPublish(): ?bool
  76.     {
  77.         return $this->autoPublish;
  78.     }
  79.     public function setAutoPublish(?bool $autoPublish): void
  80.     {
  81.         $this->autoPublish $autoPublish;
  82.     }
  83. }