src/Entity/SocialMedia.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Media\Media;
  4. use App\Entity\Program\Program;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\SocialMediaRepository")
  8.  */
  9. class SocialMedia
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true)
  19.      */
  20.     private $facebook;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=true)
  23.      */
  24.     private $instagram;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true)
  27.      */
  28.     private $twitter;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true)
  31.      */
  32.     private $snapchat;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true)
  35.      */
  36.     private $youtube;
  37.     /**
  38.      * @ORM\OneToOne(targetEntity="App\Entity\Media\Media", mappedBy="socialMedia", cascade={"persist"})
  39.      */
  40.     private $media;
  41.     /**
  42.      * @ORM\OneToOne(targetEntity="App\Entity\Program\Program", mappedBy="socialMedia", cascade={"persist"})
  43.      */
  44.     private $program;
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getFacebook(): ?string
  50.     {
  51.         return $this->facebook;
  52.     }
  53.     public function setFacebook(string $facebook): self
  54.     {
  55.         $this->facebook $facebook;
  56.         return $this;
  57.     }
  58.     public function getInstagram(): ?string
  59.     {
  60.         return $this->instagram;
  61.     }
  62.     public function setInstagram(string $instagram): self
  63.     {
  64.         $this->instagram $instagram;
  65.         return $this;
  66.     }
  67.     public function getTwitter(): ?string
  68.     {
  69.         return $this->twitter;
  70.     }
  71.     public function setTwitter(string $twitter): self
  72.     {
  73.         $this->twitter $twitter;
  74.         return $this;
  75.     }
  76.     public function getSnapchat(): ?string
  77.     {
  78.         return $this->snapchat;
  79.     }
  80.     public function setSnapchat(string $snapchat): self
  81.     {
  82.         $this->snapchat $snapchat;
  83.         return $this;
  84.     }
  85.     public function getYoutube(): ?string
  86.     {
  87.         return $this->youtube;
  88.     }
  89.     public function setYoutube(string $youtube): self
  90.     {
  91.         $this->youtube $youtube;
  92.         return $this;
  93.     }
  94.     public function getMedia(): ?Media
  95.     {
  96.         return $this->media;
  97.     }
  98.     public function setMedia(?Media $media): self
  99.     {
  100.         $this->media $media;
  101.         // set (or unset) the owning side of the relation if necessary
  102.         $newSocialMedia null === $media null $this;
  103.         if ($media->getSocialMedia() !== $newSocialMedia) {
  104.             $media->setSocialMedia($newSocialMedia);
  105.         }
  106.         return $this;
  107.     }
  108.     public function getProgram(): ?Program
  109.     {
  110.         return $this->program;
  111.     }
  112.     public function setProgram(?Program $program): self
  113.     {
  114.         $this->program $program;
  115.         // set (or unset) the owning side of the relation if necessary
  116.         $newSocialMedia null === $program null $this;
  117.         if ($program->getSocialMedia() !== $newSocialMedia) {
  118.             $program->setSocialMedia($newSocialMedia);
  119.         }
  120.         return $this;
  121.     }
  122. }