src/Entity/MediaChannel.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MediaChannelRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassMediaChannelRepository::class)]
  8. class MediaChannel
  9. {
  10.     const TRACKING_CODE "?utm_source=";
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\Column(type'string'length255nullabletrue)]
  16.     private ?string $name null;
  17.     #[ORM\Column(type'string'length255nullabletrue)]
  18.     private ?string $trackingCode null;
  19.     #[ORM\Column(type'boolean'nullabletrue)]
  20.     private ?bool $status null;
  21.     #[ORM\OneToMany(targetEntityProfile::class, mappedBy'mediaChannel')]
  22.     private Collection $profiles;
  23.     public function __construct()
  24.     {
  25.         $this->profiles = new ArrayCollection();
  26.     }
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function getName(): ?string
  32.     {
  33.         return $this->name;
  34.     }
  35.     public function setName(?string $name): self
  36.     {
  37.         $this->name $name;
  38.         return $this;
  39.     }
  40.     public function getTrackingCode(): ?string
  41.     {
  42.         return $this->trackingCode;
  43.     }
  44.     public function setTrackingCode(?string $trackingCode): self
  45.     {
  46.         $this->trackingCode $trackingCode;
  47.         return $this;
  48.     }
  49.     public function getStatus(): ?bool
  50.     {
  51.         return $this->status;
  52.     }
  53.     public function setStatus(?bool $status): self
  54.     {
  55.         $this->status $status;
  56.         return $this;
  57.     }
  58.     /**
  59.      * @return Collection<int, Profile>
  60.      */
  61.     public function getProfiles(): Collection
  62.     {
  63.         return $this->profiles;
  64.     }
  65.     public function addProfile(Profile $profile): self
  66.     {
  67.         if (!$this->profiles->contains($profile)) {
  68.             $this->profiles[] = $profile;
  69.             $profile->setMediaChannel($this);
  70.         }
  71.         return $this;
  72.     }
  73.     public function removeProfile(Profile $profile): self
  74.     {
  75.         if ($this->profiles->removeElement($profile)) {
  76.             // set the owning side to null (unless already changed)
  77.             if ($profile->getMediaChannel() === $this) {
  78.                 $profile->setMediaChannel(null);
  79.             }
  80.         }
  81.         return $this;
  82.     }
  83. }