src/Entity/SmsClientList.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SmsClientListRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassSmsClientListRepository::class)]
  8. class SmsClientList
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\ManyToOne(targetEntityAccountingFirm::class, inversedBy'smsClientLists')]
  15.     private ?AccountingFirm $accountingFirm;
  16.     #[ORM\Column(type'string'length255)]
  17.     private ?string $name;
  18.     #[ORM\Column(type'datetime_immutable')]
  19.     private ?\DateTimeImmutable $createdAt;
  20.     #[ORM\Column(type'datetime_immutable')]
  21.     private ?\DateTimeImmutable $updatedAt;
  22.     #[ORM\OneToMany(mappedBy'smsClientList'targetEntitySmsClientListNumber::class, cascade: ['persist''remove'])]
  23.     private $smsClientListNumbers;
  24.     #[ORM\OneToMany(mappedBy'diffusionList'targetEntitySmsClientCampaign::class)]
  25.     private $campaigns;
  26.     public function __construct()
  27.     {
  28.         $this->smsClientListNumbers = new ArrayCollection();
  29.         $this->campaigns = new ArrayCollection();
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getAccountingFirm(): ?AccountingFirm
  36.     {
  37.         return $this->accountingFirm;
  38.     }
  39.     public function setAccountingFirm(?AccountingFirm $accountingFirm): self
  40.     {
  41.         $this->accountingFirm $accountingFirm;
  42.         return $this;
  43.     }
  44.     public function getName(): ?string
  45.     {
  46.         return $this->name;
  47.     }
  48.     public function setName(string $name): self
  49.     {
  50.         $this->name $name;
  51.         return $this;
  52.     }
  53.     public function getCreatedAt(): ?\DateTimeImmutable
  54.     {
  55.         return $this->createdAt;
  56.     }
  57.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  58.     {
  59.         $this->createdAt $createdAt;
  60.         return $this;
  61.     }
  62.     public function getUpdatedAt(): ?\DateTimeImmutable
  63.     {
  64.         return $this->updatedAt;
  65.     }
  66.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  67.     {
  68.         $this->updatedAt $updatedAt;
  69.         return $this;
  70.     }
  71.     /**
  72.      * @return Collection<int, SmsClientListNumber>
  73.      */
  74.     public function getSmsClientListNumbers(): Collection
  75.     {
  76.         return $this->smsClientListNumbers;
  77.     }
  78.     public function addSmsClientListNumber(SmsClientListNumber $smsClientListNumber): self
  79.     {
  80.         if (!$this->smsClientListNumbers->contains($smsClientListNumber)) {
  81.             $this->smsClientListNumbers[] = $smsClientListNumber;
  82.             $smsClientListNumber->setSmsClientList($this);
  83.         }
  84.         return $this;
  85.     }
  86.     public function removeSmsClientListNumber(SmsClientListNumber $smsClientListNumber): self
  87.     {
  88.         if ($this->smsClientListNumbers->removeElement($smsClientListNumber)) {
  89.             // set the owning side to null (unless already changed)
  90.             if ($smsClientListNumber->getSmsClientList() === $this) {
  91.                 $smsClientListNumber->setSmsClientList(null);
  92.             }
  93.         }
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return Collection<int, SmsClientCampaign>
  98.      */
  99.     public function getCampaigns(): Collection
  100.     {
  101.         return $this->campaigns;
  102.     }
  103.     public function addCampaign(SmsClientCampaign $campaign): self
  104.     {
  105.         if (!$this->campaigns->contains($campaign)) {
  106.             $this->campaigns[] = $campaign;
  107.             $campaign->setDiffusionList($this);
  108.         }
  109.         return $this;
  110.     }
  111.     public function removeCampaign(SmsClientCampaign $campaign): self
  112.     {
  113.         if ($this->campaigns->removeElement($campaign)) {
  114.             // set the owning side to null (unless already changed)
  115.             if ($campaign->getDiffusionList() === $this) {
  116.                 $campaign->setDiffusionList(null);
  117.             }
  118.         }
  119.         return $this;
  120.     }
  121. }