src/Entity/Landingpage.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LandingpageRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClass: LandingpageRepository::class)]
  9. #[ORM\HasLifecycleCallbacks]
  10. class Landingpage
  11. {
  12.     use \App\Traits\EntityDateTimeAbleTrait;
  13.     
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column(type: 'integer')]
  17.     private $id;
  18.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  19.     private ?string $name = null;
  20.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  21.     private ?string $slug = null;
  22.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  23.     private ?string $eventName = null;
  24.     #[ORM\Column(type: 'date')]
  25.     private ?\DateTimeInterface $eventDate = null;
  26.     #[ORM\OneToMany(targetEntity: Profile::class, mappedBy: 'landingpage')]
  27.     private Collection $profiles;
  28.     #[ORM\OneToMany(mappedBy: 'landingpage', targetEntity: LandingpageFile::class)]
  29.     private Collection $landingpageFiles;
  30.     #[ORM\Column(length: 255, nullable: true)]
  31.     private ?string $video = null;
  32.     #[ORM\Column(type: Types::TEXT, nullable: true)]
  33.     private ?string $description = null;
  34.     #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
  35.     private ?\DateTimeInterface $eventEndDate = null;
  36.     #[ORM\ManyToOne(inversedBy: 'landingpages')]
  37.     private ?Campaign $campaign = null;
  38.     #[ORM\Column(nullable: true)]
  39.     private ?bool $isAgent = null;
  40.     #[ORM\OneToMany(mappedBy: 'agent', targetEntity: Partenaire::class)]
  41.     private Collection $partenaires;
  42.     #[ORM\OneToMany(mappedBy: 'landingpage', targetEntity: User::class)]
  43.     private Collection $users;
  44.     public function __construct()
  45.     {
  46.         $this->profiles = new ArrayCollection();
  47.         $this->landingpageFiles = new ArrayCollection();
  48.         $this->partenaires = new ArrayCollection();
  49.         $this->users = new ArrayCollection();
  50.     }
  51.     public function getId(): ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getName(): ?string
  56.     {
  57.         return $this->name;
  58.     }
  59.     public function setName(?string $name): self
  60.     {
  61.         $this->name = $name;
  62.         return $this;
  63.     }
  64.     public function getSlug(): ?string
  65.     {
  66.         return $this->slug;
  67.     }
  68.     public function setSlug(?string $slug): self
  69.     {
  70.         $this->slug = $slug;
  71.         return $this;
  72.     }
  73.     public function getEventName(): ?string
  74.     {
  75.         return $this->eventName;
  76.     }
  77.     public function setEventName(?string $eventName): self
  78.     {
  79.         $this->eventName = $eventName;
  80.         return $this;
  81.     }
  82.     public function getEventDate(): ?\DateTimeInterface
  83.     {
  84.         return $this->eventDate;
  85.     }
  86.     public function setEventDate(\DateTimeInterface $eventDate): self
  87.     {
  88.         $this->eventDate = $eventDate;
  89.         return $this;
  90.     }
  91.     /**
  92.      * @return Collection<int, Profile>
  93.      */
  94.     public function getProfiles(): Collection
  95.     {
  96.         return $this->profiles;
  97.     }
  98.     public function addProfile(Profile $profile): self
  99.     {
  100.         if (!$this->profiles->contains($profile)) {
  101.             $this->profiles[] = $profile;
  102.             $profile->setLandingpage($this);
  103.         }
  104.         return $this;
  105.     }
  106.     public function removeProfile(Profile $profile): self
  107.     {
  108.         if ($this->profiles->removeElement($profile)) {
  109.             // set the owning side to null (unless already changed)
  110.             if ($profile->getLandingpage() === $this) {
  111.                 $profile->setLandingpage(null);
  112.             }
  113.         }
  114.         return $this;
  115.     }
  116.     /**
  117.      * @return Collection<int, LandingpageFile>
  118.      */
  119.     public function getLandingpageFiles(): Collection
  120.     {
  121.         return $this->landingpageFiles;
  122.     }
  123.     public function addLandingpageFile(LandingpageFile $landingpageFile): static
  124.     {
  125.         if (!$this->landingpageFiles->contains($landingpageFile)) {
  126.             $this->landingpageFiles->add($landingpageFile);
  127.             $landingpageFile->setLandingpage($this);
  128.         }
  129.         return $this;
  130.     }
  131.     public function removeLandingpageFile(LandingpageFile $landingpageFile): static
  132.     {
  133.         if ($this->landingpageFiles->removeElement($landingpageFile)) {
  134.             // set the owning side to null (unless already changed)
  135.             if ($landingpageFile->getLandingpage() === $this) {
  136.                 $landingpageFile->setLandingpage(null);
  137.             }
  138.         }
  139.         return $this;
  140.     }
  141.     public function getVideo(): ?string
  142.     {
  143.         return $this->video;
  144.     }
  145.     public function setVideo(?string $video): static
  146.     {
  147.         $this->video = $video;
  148.         return $this;
  149.     }
  150.     public function getDescription(): ?string
  151.     {
  152.         return $this->description;
  153.     }
  154.     public function setDescription(?string $description): static
  155.     {
  156.         $this->description = $description;
  157.         return $this;
  158.     }
  159.     public function getEventEndDate(): ?\DateTimeInterface
  160.     {
  161.         return $this->eventEndDate;
  162.     }
  163.     public function setEventEndDate(?\DateTimeInterface $eventEndDate): static
  164.     {
  165.         $this->eventEndDate = $eventEndDate;
  166.         return $this;
  167.     }
  168.     public function getCampaign(): ?Campaign
  169.     {
  170.         return $this->campaign;
  171.     }
  172.     public function setCampaign(?Campaign $campaign): static
  173.     {
  174.         $this->campaign = $campaign;
  175.         return $this;
  176.     }
  177.     public function isIsAgent(): ?bool
  178.     {
  179.         return $this->isAgent;
  180.     }
  181.     public function setIsAgent(?bool $isAgent): static
  182.     {
  183.         $this->isAgent = $isAgent;
  184.         return $this;
  185.     }
  186.     /**
  187.      * @return Collection<int, Partenaire>
  188.      */
  189.     public function getPartenaires(): Collection
  190.     {
  191.         return $this->partenaires;
  192.     }
  193.     public function addPartenaire(Partenaire $partenaire): static
  194.     {
  195.         if (!$this->partenaires->contains($partenaire)) {
  196.             $this->partenaires->add($partenaire);
  197.             $partenaire->setAgent($this);
  198.         }
  199.         return $this;
  200.     }
  201.     public function removePartenaire(Partenaire $partenaire): static
  202.     {
  203.         if ($this->partenaires->removeElement($partenaire)) {
  204.             // set the owning side to null (unless already changed)
  205.             if ($partenaire->getAgent() === $this) {
  206.                 $partenaire->setAgent(null);
  207.             }
  208.         }
  209.         return $this;
  210.     }
  211.     /**
  212.      * @return Collection<int, User>
  213.      */
  214.     public function getUsers(): Collection
  215.     {
  216.         return $this->users;
  217.     }
  218.     public function addUser(User $user): static
  219.     {
  220.         if (!$this->users->contains($user)) {
  221.             $this->users->add($user);
  222.             $user->setLandingpage($this);
  223.         }
  224.         return $this;
  225.     }
  226.     public function removeUser(User $user): static
  227.     {
  228.         if ($this->users->removeElement($user)) {
  229.             // set the owning side to null (unless already changed)
  230.             if ($user->getLandingpage() === $this) {
  231.                 $user->setLandingpage(null);
  232.             }
  233.         }
  234.         return $this;
  235.     }
  236. }