src/Entity/Gos/RenewalOffer/SuggestedVariant.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos\RenewalOffer;
  3. use App\Entity\Gos\ProductVariant;
  4. use App\Repository\Gos\RenewalOffer\SuggestedVariantRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=SuggestedVariantRepository::class)
  10.  */
  11. class SuggestedVariant
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity=RenewalOffer::class, inversedBy="suggestedVariants")
  21.      * @ORM\JoinColumn(nullable=false)
  22.      */
  23.     private $renewalOffer;
  24.     /**
  25.      * @ORM\ManyToMany(targetEntity=ProductVariant::class)
  26.      */
  27.     private $sourceVariant;
  28.     /**
  29.      * @ORM\ManyToOne(targetEntity=ProductVariant::class)
  30.      * @ORM\JoinColumn(nullable=false)
  31.      */
  32.     private $targetVariant;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true)
  35.      */
  36.     private $label;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, nullable=true)
  39.      */
  40.     private $description;
  41.     public function __construct()
  42.     {
  43.         $this->sourceVariant = new ArrayCollection();
  44.     }
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getRenewalOffer(): ?RenewalOffer
  50.     {
  51.         return $this->renewalOffer;
  52.     }
  53.     public function setRenewalOffer(?RenewalOffer $renewalOffer): self
  54.     {
  55.         $this->renewalOffer $renewalOffer;
  56.         return $this;
  57.     }
  58.     /**
  59.      * @return Collection|ProductVariant[]
  60.      */
  61.     public function getSourceVariant(): Collection
  62.     {
  63.         return $this->sourceVariant;
  64.     }
  65.     public function addSourceVariant(ProductVariant $sourceVariant): self
  66.     {
  67.         if (!$this->sourceVariant->contains($sourceVariant)) {
  68.             $this->sourceVariant[] = $sourceVariant;
  69.         }
  70.         return $this;
  71.     }
  72.     public function removeSourceVariant(ProductVariant $sourceVariant): self
  73.     {
  74.         if ($this->sourceVariant->contains($sourceVariant)) {
  75.             $this->sourceVariant->removeElement($sourceVariant);
  76.         }
  77.         return $this;
  78.     }
  79.     public function getTargetVariant(): ?ProductVariant
  80.     {
  81.         return $this->targetVariant;
  82.     }
  83.     public function setTargetVariant(?ProductVariant $targetVariant): self
  84.     {
  85.         $this->targetVariant $targetVariant;
  86.         return $this;
  87.     }
  88.     public function getLabel(): ?string
  89.     {
  90.         return $this->label;
  91.     }
  92.     public function setLabel(?string $label): self
  93.     {
  94.         $this->label $label;
  95.         return $this;
  96.     }
  97.     public function getDescription(): ?string
  98.     {
  99.         return $this->description;
  100.     }
  101.     public function setDescription(?string $description): self
  102.     {
  103.         $this->description $description;
  104.         return $this;
  105.     }
  106. }