src/Entity/SmsClientCampaign.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SmsClientCampaignRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassSmsClientCampaignRepository::class)]
  8. class SmsClientCampaign
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $name;
  16.     #[ORM\Column(type'string'length160nullabletrue)]
  17.     private $message;
  18.     #[ORM\ManyToOne(targetEntitySmsClientList::class, inversedBy'campaigns')]
  19.     private $diffusionList;
  20.     #[ORM\Column(type'datetime'nullabletrue)]
  21.     private $sendDate;
  22.     #[ORM\Column(type'string'length255)]
  23.     private $status;
  24.     #[ORM\ManyToOne(targetEntityAccountingFirm::class, inversedBy'smsClientCampaigns')]
  25.     private $accountingFirm;
  26.     #[ORM\Column(type'integer'nullabletrue)]
  27.     private $smsUsed;
  28.         #[ORM\Column(type'json'nullabletrue)]
  29.     private $selectedCategories = [];
  30.     #[ORM\Column(type'json'nullabletrue)]
  31.     private $selectedTags = [];
  32.     public function getId(): ?int
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getName(): ?string
  37.     {
  38.         return $this->name;
  39.     }
  40.     public function setName(string $name): self
  41.     {
  42.         $this->name $name;
  43.         return $this;
  44.     }
  45.     public function getMessage(): ?string
  46.     {
  47.         return $this->message;
  48.     }
  49.     public function setMessage(string $message): self
  50.     {
  51.         $this->message $message;
  52.         return $this;
  53.     }
  54.     public function getDiffusionList(): ?SmsClientList
  55.     {
  56.         return $this->diffusionList;
  57.     }
  58.     public function setDiffusionList(?SmsClientList $diffusionList): self
  59.     {
  60.         $this->diffusionList $diffusionList;
  61.         return $this;
  62.     }
  63.     public function getSendDate(): ?\DateTime
  64.     {
  65.         return $this->sendDate;
  66.     }
  67.     public function setSendDate(?\DateTime $sendDate): self
  68.     {
  69.         $this->sendDate $sendDate;
  70.         return $this;
  71.     }
  72.     public function getStatus(): ?string
  73.     {
  74.         return $this->status;
  75.     }
  76.     public function setStatus(string $status): self
  77.     {
  78.         $this->status $status;
  79.         return $this;
  80.     }
  81.     public function getAccountingFirm(): ?AccountingFirm
  82.     {
  83.         return $this->accountingFirm;
  84.     }
  85.     public function setAccountingFirm(?AccountingFirm $accountingFirm): self
  86.     {
  87.         $this->accountingFirm $accountingFirm;
  88.         return $this;
  89.     }
  90.     public function getSmsUsed(): ?int
  91.     {
  92.         return $this->smsUsed;
  93.     }
  94.     public function setSmsUsed(?int $smsUsed): self
  95.     {
  96.         $this->smsUsed $smsUsed;
  97.         return $this;
  98.     }
  99.     public function getSelectedCategories(): ?array
  100.     {
  101.         return $this->selectedCategories;
  102.     }
  103.     public function setSelectedCategories(ArrayCollection|array $selectedCategories): self
  104.     {
  105.         if ($selectedCategories instanceof Collection) {
  106.             $this->selectedCategories $selectedCategories->map(fn($cat) => $cat->getId())->toArray();
  107.         } elseif (is_array($selectedCategories)) {
  108.             $this->selectedCategories $selectedCategories;
  109.         } else {
  110.             $this->selectedCategories = [];
  111.         }
  112.         return $this;
  113.     }
  114.     public function getSelectedTags(): ?array
  115.     {
  116.         return $this->selectedTags;
  117.     }
  118.     public function setSelectedTags(ArrayCollection|array $selectedTags): self
  119.     {
  120.         if ($selectedTags instanceof Collection) {
  121.             $this->selectedTags $selectedTags->map(fn($tag) => $tag->getId())->toArray();
  122.         } elseif (is_array($selectedTags)) {
  123.             $this->selectedTags $selectedTags;
  124.         } else {
  125.             $this->selectedTags = [];
  126.         }
  127.         return $this;
  128.     }
  129. }