src/Entity/Gos/ShippingType.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use App\Repository\Gos\ShippingTypeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ShippingTypeRepository::class)
  9.  */
  10. class ShippingType
  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)
  20.      */
  21.     private $title;
  22.     /**
  23.      * @ORM\ManyToMany(targetEntity=ProductVariant::class, mappedBy="shippingTypes")
  24.      */
  25.     private $productVariants;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=ProductVariant::class)
  28.      * @ORM\JoinColumn(nullable=true)
  29.      */
  30.     private $shippingProductVariant;
  31.     /**
  32.      * @ORM\Column(type="boolean", options={"default":0})
  33.      */
  34.     private $isDefault false;
  35.     /**
  36.      * @ORM\Column(type="integer", nullable=true)
  37.      */
  38.     private $gosShippingType;
  39.     /**
  40.      * @ORM\Column(type="boolean", options={"default":0})
  41.      */
  42.     private $isPhoneRequired false;
  43.     public function __construct()
  44.     {
  45.         $this->productVariants = new ArrayCollection();
  46.     }
  47.     public function __toString(): string
  48.     {
  49.         return $this->title;
  50.     }
  51.     public function getId(): ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getTitle(): ?string
  56.     {
  57.         return $this->title;
  58.     }
  59.     public function setTitle(string $title): self
  60.     {
  61.         $this->title $title;
  62.         return $this;
  63.     }
  64.     /**
  65.      * @return Collection|ProductVariant[]
  66.      */
  67.     public function getProductVariants(): Collection
  68.     {
  69.         return $this->productVariants;
  70.     }
  71.     public function addProductVariant(ProductVariant $productVariant): self
  72.     {
  73.         if (!$this->productVariants->contains($productVariant)) {
  74.             $this->productVariants[] = $productVariant;
  75.             $productVariant->addShippingType($this);
  76.         }
  77.         return $this;
  78.     }
  79.     public function removeProductVariant(ProductVariant $productVariant): self
  80.     {
  81.         if ($this->productVariants->contains($productVariant)) {
  82.             $this->productVariants->removeElement($productVariant);
  83.             $productVariant->removeShippingType($this);
  84.         }
  85.         return $this;
  86.     }
  87.     public function getShippingProductVariant(): ?ProductVariant
  88.     {
  89.         return $this->shippingProductVariant;
  90.     }
  91.     public function setShippingProductVariant(?ProductVariant $shippingProductVariant): self
  92.     {
  93.         $this->shippingProductVariant $shippingProductVariant;
  94.         return $this;
  95.     }
  96.     public function getIsDefault(): ?bool
  97.     {
  98.         return $this->isDefault;
  99.     }
  100.     public function setIsDefault(bool $isDefault): self
  101.     {
  102.         $this->isDefault $isDefault;
  103.         return $this;
  104.     }
  105.     public function getGosShippingType(): ?int
  106.     {
  107.         return $this->gosShippingType;
  108.     }
  109.     public function setGosShippingType(?int $gosShippingType): self
  110.     {
  111.         $this->gosShippingType $gosShippingType;
  112.         return $this;
  113.     }
  114.     public function getIsPhoneRequired(): ?bool
  115.     {
  116.         return $this->isPhoneRequired;
  117.     }
  118.     public function setIsPhoneRequired(bool $isPhoneRequired): self
  119.     {
  120.         $this->isPhoneRequired $isPhoneRequired;
  121.         return $this;
  122.     }
  123. }