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.     #[ORM\OneToMany(mappedBy'campaign'targetEntityLandingpage::class)]
  30.     private Collection $landingpages;
  31.     public function __construct()
  32.     {
  33.         $this->profiles = new ArrayCollection();
  34.         $this->openDays = new ArrayCollection();
  35.         $this->landingpages = new ArrayCollection();
  36.     }
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getName(): ?string
  42.     {
  43.         return $this->name;
  44.     }
  45.     public function setName(string $name): self
  46.     {
  47.         $this->name $name;
  48.         return $this;
  49.     }
  50.     /**
  51.      * @return Collection<int, Profile>
  52.      */
  53.     public function getProfiles(): Collection
  54.     {
  55.         return $this->profiles;
  56.     }
  57.     public function addProfile(Profile $profile): self
  58.     {
  59.         if (!$this->profiles->contains($profile)) {
  60.             $this->profiles[] = $profile;
  61.             $profile->setCampaign($this);
  62.         }
  63.         return $this;
  64.     }
  65.     public function removeProfile(Profile $profile): self
  66.     {
  67.         if ($this->profiles->removeElement($profile)) {
  68.             // set the owning side to null (unless already changed)
  69.             if ($profile->getCampaign() === $this) {
  70.                 $profile->setCampaign(null);
  71.             }
  72.         }
  73.         return $this;
  74.     }
  75.     public function getType(): ?string
  76.     {
  77.         return $this->type;
  78.     }
  79.     public function setType(?string $type): self
  80.     {
  81.         $this->type $type;
  82.         return $this;
  83.     }
  84.     public function getOrdering(): ?int
  85.     {
  86.         return $this->ordering;
  87.     }
  88.     public function setOrdering(?int $ordering): self
  89.     {
  90.         $this->ordering $ordering;
  91.         return $this;
  92.     }
  93.     /**
  94.      * @return Collection<int, OpenDay>
  95.      */
  96.     public function getOpenDays(): Collection
  97.     {
  98.         return $this->openDays;
  99.     }
  100.     public function addOpenDay(OpenDay $openDay): self
  101.     {
  102.         if (!$this->openDays->contains($openDay)) {
  103.             $this->openDays[] = $openDay;
  104.             $openDay->setCampaign($this);
  105.         }
  106.         return $this;
  107.     }
  108.     public function removeOpenDay(OpenDay $openDay): self
  109.     {
  110.         if ($this->openDays->removeElement($openDay)) {
  111.             // set the owning side to null (unless already changed)
  112.             if ($openDay->getCampaign() === $this) {
  113.                 $openDay->setCampaign(null);
  114.             }
  115.         }
  116.         return $this;
  117.     }
  118.     /**
  119.      * @return Collection<int, Landingpage>
  120.      */
  121.     public function getLandingpages(): Collection
  122.     {
  123.         return $this->landingpages;
  124.     }
  125.     public function addLandingpage(Landingpage $landingpage): static
  126.     {
  127.         if (!$this->landingpages->contains($landingpage)) {
  128.             $this->landingpages->add($landingpage);
  129.             $landingpage->setCampaign($this);
  130.         }
  131.         return $this;
  132.     }
  133.     public function removeLandingpage(Landingpage $landingpage): static
  134.     {
  135.         if ($this->landingpages->removeElement($landingpage)) {
  136.             // set the owning side to null (unless already changed)
  137.             if ($landingpage->getCampaign() === $this) {
  138.                 $landingpage->setCampaign(null);
  139.             }
  140.         }
  141.         return $this;
  142.     }
  143. }