src/Admin/Modules/OnlineService/Entity/OnlineService.php line 15

  1. <?php
  2. namespace App\Admin\Modules\OnlineService\Entity;
  3. use App\Admin\Modules\OfferGenerator\Entity\OfferGeneratorPriceListGroupItem;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Table(name="online_service", indexes={@ORM\Index(columns={"name"})})
  10.  * @ORM\Entity(repositoryClass="App\Admin\Modules\OnlineService\Repository\OnlineServiceRepository")
  11.  */
  12. class OnlineService
  13. {
  14.     /**
  15.      * @ORM\Column(type="integer")
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue(strategy="AUTO")
  18.      */
  19.     protected $id;
  20.     
  21.     /**
  22.      * @ORM\Column(name="name", type="string", length=255, nullable=false, options={"collation"="utf8_unicode_ci"})
  23.      */
  24.     private $name;
  25.     /**
  26.      * @ORM\Column(name="description", type="text", length=65535, nullable=false)
  27.      */
  28.     private $description;
  29.     
  30.     /**
  31.      * @ORM\Column(name="image", type="string", length=255, nullable=true)
  32.      */
  33.     private $image;
  34.     /**
  35.      * @ORM\Column(name="items_price", type="decimal", precision=14, scale=2, nullable=true)
  36.      */
  37.     private $itemsPrice;
  38.     
  39.     /**
  40.      * @ORM\Column(name="discount", type="float", nullable=true)
  41.      */
  42.     private $discount;    
  43.     /**
  44.      * @ORM\Column(name="price", type="decimal", precision=14, scale=2, nullable=true)
  45.      */
  46.     private $price;
  47.     
  48.     /**
  49.      * @ORM\ManyToMany(targetEntity="App\Admin\Modules\OfferGenerator\Entity\OfferGeneratorPriceListGroupItem")
  50.      * @ORM\JoinTable(name="online_service_price_list_item",
  51.      *      joinColumns={@ORM\JoinColumn(name="id_online_service", referencedColumnName="id", onDelete="CASCADE")},
  52.      *      inverseJoinColumns={@ORM\JoinColumn(name="id_offer_generator_price_list_group_item", referencedColumnName="id", onDelete="CASCADE")}
  53.      *    )
  54.      **/
  55.     private $priceListItems;
  56.     public function __construct()
  57.     {
  58.         $this->priceListItems = new ArrayCollection();
  59.     }
  60.     public function getId(): ?int
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function getName(): ?string
  65.     {
  66.         return $this->name;
  67.     }
  68.     public function setName(string $name): self
  69.     {
  70.         $this->name $name;
  71.         return $this;
  72.     }
  73.     public function getDescription(): ?string
  74.     {
  75.         return $this->description;
  76.     }
  77.     public function setDescription(string $description): self
  78.     {
  79.         $this->description $description;
  80.         return $this;
  81.     }
  82.     public function getImage(): ?string
  83.     {
  84.         return $this->image;
  85.     }
  86.     public function setImage(?string $image): self
  87.     {
  88.         $this->image $image;
  89.         return $this;
  90.     }
  91.     public function getItemsPrice(): ?string
  92.     {
  93.         return $this->itemsPrice;
  94.     }
  95.     public function setItemsPrice(?string $itemsPrice): self
  96.     {
  97.         $this->itemsPrice $itemsPrice;
  98.         return $this;
  99.     }
  100.     public function getDiscount(): ?float
  101.     {
  102.         return $this->discount;
  103.     }
  104.     public function setDiscount(?float $discount): self
  105.     {
  106.         $this->discount $discount;
  107.         return $this;
  108.     }
  109.     public function getPrice(): ?string
  110.     {
  111.         return $this->price;
  112.     }
  113.     public function setPrice(?string $price): self
  114.     {
  115.         $this->price $price;
  116.         return $this;
  117.     }
  118.     /**
  119.      * @return Collection<int, OfferGeneratorPriceListGroupItem>
  120.      */
  121.     public function getPriceListItems(): Collection
  122.     {
  123.         return $this->priceListItems;
  124.     }
  125.     public function addPriceListItem(OfferGeneratorPriceListGroupItem $priceListItem): self
  126.     {
  127.         if (!$this->priceListItems->contains($priceListItem)) {
  128.             $this->priceListItems->add($priceListItem);
  129.         }
  130.         return $this;
  131.     }
  132.     public function removePriceListItem(OfferGeneratorPriceListGroupItem $priceListItem): self
  133.     {
  134.         $this->priceListItems->removeElement($priceListItem);
  135.         return $this;
  136.     }
  137. }