src/Entity/Contributor.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ContributorRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ContributorRepository::class)
  9.  */
  10. class Contributor
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255, nullable=true)
  20.      */
  21.     private $label1;
  22.     /**
  23.      * @ORM\Column(type="string", length=255, nullable=true)
  24.      */
  25.     private $field1;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $label2;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      */
  33.     private $field2;
  34.     /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      */
  37.     private $label3;
  38.     /**
  39.      * @ORM\Column(type="string", length=255, nullable=true)
  40.      */
  41.     private $field3;
  42.     /**
  43.      * @ORM\Column(type="string", length=255, nullable=true)
  44.      */
  45.     private $label4;
  46.     /**
  47.      * @ORM\Column(type="string", length=255, nullable=true)
  48.      */
  49.     private $field4;
  50.     /**
  51.      * @ORM\Column(type="string", length=255, nullable=true)
  52.      */
  53.     private $label5;
  54.     /**
  55.      * @ORM\Column(type="string", length=255, nullable=true)
  56.      */
  57.     private $field5;
  58.     /**
  59.      * @ORM\Column(type="string", length=255, nullable=true)
  60.      */
  61.     private $label6;
  62.     /**
  63.      * @ORM\Column(type="string", length=255, nullable=true)
  64.      */
  65.     private $field6;
  66.     /**
  67.      * @ORM\Column(type="string", length=255, nullable=true)
  68.      */
  69.     private $label7;
  70.     /**
  71.      * @ORM\Column(type="string", length=255, nullable=true)
  72.      */
  73.     private $field7;
  74.     /**
  75.      * @ORM\Column(type="string", length=255, nullable=true)
  76.      */
  77.     private $labelTextarea;
  78.     /**
  79.      * @ORM\Column(type="text", nullable=true)
  80.      */
  81.     private $textarea;
  82.     /**
  83.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="contributors")
  84.      */
  85.     private $user;
  86.     /**
  87.      * @ORM\Column(type="string", length=255, nullable=true)
  88.      */
  89.     private $labelMedia;
  90.     /**
  91.      * @ORM\OneToMany(targetEntity=Media::class, mappedBy="contributor", cascade={"remove"})
  92.      */
  93.     private $media;
  94.     public function __construct()
  95.     {
  96.         $this->media = new ArrayCollection();
  97.     }
  98.     public function getId(): ?int
  99.     {
  100.         return $this->id;
  101.     }
  102.     public function getLabel1(): ?string
  103.     {
  104.         return $this->label1;
  105.     }
  106.     public function setLabel1(?string $label1): self
  107.     {
  108.         $this->label1 $label1;
  109.         return $this;
  110.     }
  111.     public function getField1(): ?string
  112.     {
  113.         return $this->field1;
  114.     }
  115.     public function setField1(?string $field1): self
  116.     {
  117.         $this->field1 $field1;
  118.         return $this;
  119.     }
  120.     public function getLabel2(): ?string
  121.     {
  122.         return $this->label2;
  123.     }
  124.     public function setLabel2(?string $label2): self
  125.     {
  126.         $this->label2 $label2;
  127.         return $this;
  128.     }
  129.     public function getField2(): ?string
  130.     {
  131.         return $this->field2;
  132.     }
  133.     public function setField2(?string $field2): self
  134.     {
  135.         $this->field2 $field2;
  136.         return $this;
  137.     }
  138.     public function getLabel3(): ?string
  139.     {
  140.         return $this->label3;
  141.     }
  142.     public function setLabel3(?string $label3): self
  143.     {
  144.         $this->label3 $label3;
  145.         return $this;
  146.     }
  147.     public function getField3(): ?string
  148.     {
  149.         return $this->field3;
  150.     }
  151.     public function setField3(?string $field3): self
  152.     {
  153.         $this->field3 $field3;
  154.         return $this;
  155.     }
  156.     public function getLabel4(): ?string
  157.     {
  158.         return $this->label4;
  159.     }
  160.     public function setLabel4(?string $label4): self
  161.     {
  162.         $this->label4 $label4;
  163.         return $this;
  164.     }
  165.     public function getField4(): ?string
  166.     {
  167.         return $this->field4;
  168.     }
  169.     public function setField4(?string $field4): self
  170.     {
  171.         $this->field4 $field4;
  172.         return $this;
  173.     }
  174.     public function getLabel5(): ?string
  175.     {
  176.         return $this->label5;
  177.     }
  178.     public function setLabel5(?string $label5): self
  179.     {
  180.         $this->label5 $label5;
  181.         return $this;
  182.     }
  183.     public function getField5(): ?string
  184.     {
  185.         return $this->field5;
  186.     }
  187.     public function setField5(?string $field5): self
  188.     {
  189.         $this->field5 $field5;
  190.         return $this;
  191.     }
  192.     public function getLabel6(): ?string
  193.     {
  194.         return $this->label6;
  195.     }
  196.     public function setLabel6(?string $label6): self
  197.     {
  198.         $this->label6 $label6;
  199.         return $this;
  200.     }
  201.     public function getField6(): ?string
  202.     {
  203.         return $this->field6;
  204.     }
  205.     public function setField6(?string $field6): self
  206.     {
  207.         $this->field6 $field6;
  208.         return $this;
  209.     }
  210.     public function getLabel7(): ?string
  211.     {
  212.         return $this->label7;
  213.     }
  214.     public function setLabel7(?string $label7): self
  215.     {
  216.         $this->label7 $label7;
  217.         return $this;
  218.     }
  219.     public function getField7(): ?string
  220.     {
  221.         return $this->field7;
  222.     }
  223.     public function setField7(?string $field7): self
  224.     {
  225.         $this->field7 $field7;
  226.         return $this;
  227.     }
  228.     public function getLabelTextarea(): ?string
  229.     {
  230.         return $this->labelTextarea;
  231.     }
  232.     public function setLabelTextarea(?string $labelTextarea): self
  233.     {
  234.         $this->labelTextarea $labelTextarea;
  235.         return $this;
  236.     }
  237.     public function getTextarea(): ?string
  238.     {
  239.         return $this->textarea;
  240.     }
  241.     public function setTextarea(?string $textarea): self
  242.     {
  243.         $this->textarea $textarea;
  244.         return $this;
  245.     }
  246.     public function getUser(): ?User
  247.     {
  248.         return $this->user;
  249.     }
  250.     public function setUser(?User $user): self
  251.     {
  252.         $this->user $user;
  253.         return $this;
  254.     }
  255.     public function getLabelMedia(): ?string
  256.     {
  257.         return $this->labelMedia;
  258.     }
  259.     public function setLabelMedia(?string $labelMedia): self
  260.     {
  261.         $this->labelMedia $labelMedia;
  262.         return $this;
  263.     }
  264.     /**
  265.      * @return Collection<int, Media>
  266.      */
  267.     public function getMedia(): Collection
  268.     {
  269.         return $this->media;
  270.     }
  271.     public function getFirstMedia()
  272.     {
  273.         return $this->media->first();
  274.     }
  275.     public function addMedia(Media $medium): self
  276.     {
  277.         if (!$this->media->contains($medium)) {
  278.             $this->media[] = $medium;
  279.             $medium->setContributor($this);
  280.         }
  281.         return $this;
  282.     }
  283.     public function removeMedia(Media $medium): self
  284.     {
  285.         if ($this->media->removeElement($medium)) {
  286.             // set the owning side to null (unless already changed)
  287.             if ($medium->getContributor() === $this) {
  288.                 $medium->setContributor(null);
  289.             }
  290.         }
  291.         return $this;
  292.     }
  293. }