src/Entity/Campaign.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CampaignRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassCampaignRepository::class)]
  8. class Campaign
  9. {
  10.     const JPO_TYPE 1;
  11.     const APPLICATION 4;
  12.     const APPOINTMENT 2;
  13.     const DOCUMENT 3;
  14.     const LANDING_PAGE 9;
  15.     #[ORM\Id]
  16.     #[ORM\GeneratedValue]
  17.     #[ORM\Column(type'integer')]
  18.     private $id;
  19.     #[ORM\Column(type'string'length255)]
  20.     private ?string $name null;
  21.     #[ORM\OneToMany(targetEntityProfile::class, mappedBy'campaign')]
  22.     private Collection $profiles;
  23.     #[ORM\Column(type'integer'nullabletrue)]
  24.     private ?string $type null;
  25.     #[ORM\Column(type'integer'nullabletrue)]
  26.     private ?int $ordering null;
  27.     #[ORM\OneToMany(targetEntityOpenDay::class, mappedBy'campaign')]
  28.     private Collection $openDays;
  29.     public function __construct()
  30.     {
  31.         $this->profiles = new ArrayCollection();
  32.         $this->openDays = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getName(): ?string
  39.     {
  40.         return $this->name;
  41.     }
  42.     public function setName(string $name): self
  43.     {
  44.         $this->name $name;
  45.         return $this;
  46.     }
  47.     /**
  48.      * @return Collection<int, Profile>
  49.      */
  50.     public function getProfiles(): Collection
  51.     {
  52.         return $this->profiles;
  53.     }
  54.     public function addProfile(Profile $profile): self
  55.     {
  56.         if (!$this->profiles->contains($profile)) {
  57.             $this->profiles[] = $profile;
  58.             $profile->setCampaign($this);
  59.         }
  60.         return $this;
  61.     }
  62.     public function removeProfile(Profile $profile): self
  63.     {
  64.         if ($this->profiles->removeElement($profile)) {
  65.             // set the owning side to null (unless already changed)
  66.             if ($profile->getCampaign() === $this) {
  67.                 $profile->setCampaign(null);
  68.             }
  69.         }
  70.         return $this;
  71.     }
  72.     public function getType(): ?string
  73.     {
  74.         return $this->type;
  75.     }
  76.     public function setType(?string $type): self
  77.     {
  78.         $this->type $type;
  79.         return $this;
  80.     }
  81.     public function getOrdering(): ?int
  82.     {
  83.         return $this->ordering;
  84.     }
  85.     public function setOrdering(?int $ordering): self
  86.     {
  87.         $this->ordering $ordering;
  88.         return $this;
  89.     }
  90.     /**
  91.      * @return Collection<int, OpenDay>
  92.      */
  93.     public function getOpenDays(): Collection
  94.     {
  95.         return $this->openDays;
  96.     }
  97.     public function addOpenDay(OpenDay $openDay): self
  98.     {
  99.         if (!$this->openDays->contains($openDay)) {
  100.             $this->openDays[] = $openDay;
  101.             $openDay->setCampaign($this);
  102.         }
  103.         return $this;
  104.     }
  105.     public function removeOpenDay(OpenDay $openDay): self
  106.     {
  107.         if ($this->openDays->removeElement($openDay)) {
  108.             // set the owning side to null (unless already changed)
  109.             if ($openDay->getCampaign() === $this) {
  110.                 $openDay->setCampaign(null);
  111.             }
  112.         }
  113.         return $this;
  114.     }
  115. }