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\ManyToOne(targetEntity="App\Admin\Modules\OnlineService\Entity\OnlineServiceCategory")
  23.      * @ORM\JoinColumns({
  24.      *   @ORM\JoinColumn(name="id_online_service_category", referencedColumnName="id", nullable=false, onDelete="RESTRICT")
  25.      * })
  26.      */
  27.     private $category;
  28.     /**
  29.      * @ORM\Column(name="name", type="string", length=255, nullable=false, options={"collation"="utf8_unicode_ci"})
  30.      */
  31.     private $name;
  32.     /**
  33.      * @ORM\Column(name="description", type="string", length=2048, nullable=false)
  34.      */
  35.     private $description;
  36.     
  37.     /**
  38.      * @ORM\Column(name="image", type="string", length=255, nullable=true)
  39.      */
  40.     private $image;
  41.     /**
  42.      * @ORM\Column(name="items_price", type="decimal", precision=14, scale=2, nullable=true)
  43.      */
  44.     private $itemsPrice;
  45.     
  46.     /**
  47.      * @ORM\Column(name="discount", type="float", nullable=true)
  48.      */
  49.     private $discount;    
  50.     /**
  51.      * @ORM\Column(name="price", type="decimal", precision=14, scale=2, nullable=true)
  52.      */
  53.     private $price;
  54.     
  55.     /**
  56.      * @ORM\ManyToMany(targetEntity="App\Admin\Modules\OfferGenerator\Entity\OfferGeneratorPriceListGroupItem")
  57.      * @ORM\JoinTable(name="online_service_price_list_item",
  58.      *      joinColumns={@ORM\JoinColumn(name="id_online_service", referencedColumnName="id", onDelete="CASCADE")},
  59.      *      inverseJoinColumns={@ORM\JoinColumn(name="id_offer_generator_price_list_group_item", referencedColumnName="id", onDelete="CASCADE")}
  60.      *    )
  61.      **/
  62.     private $priceListItems;
  63.     public function __construct()
  64.     {
  65.         $this->priceListItems = new ArrayCollection();
  66.     }
  67.     public function getId(): ?int
  68.     {
  69.         return $this->id;
  70.     }
  71.     public function getName(): ?string
  72.     {
  73.         return $this->name;
  74.     }
  75.     public function setName(string $name): self
  76.     {
  77.         $this->name $name;
  78.         return $this;
  79.     }
  80.     public function getDescription(): ?string
  81.     {
  82.         return $this->description;
  83.     }
  84.     public function setDescription(string $description): self
  85.     {
  86.         $this->description $description;
  87.         return $this;
  88.     }
  89.     public function getImage(): ?string
  90.     {
  91.         return $this->image;
  92.     }
  93.     public function setImage(?string $image): self
  94.     {
  95.         $this->image $image;
  96.         return $this;
  97.     }
  98.     public function getItemsPrice(): ?string
  99.     {
  100.         return $this->itemsPrice;
  101.     }
  102.     public function setItemsPrice(?string $itemsPrice): self
  103.     {
  104.         $this->itemsPrice $itemsPrice;
  105.         return $this;
  106.     }
  107.     public function getDiscount(): ?float
  108.     {
  109.         return $this->discount;
  110.     }
  111.     public function setDiscount(?float $discount): self
  112.     {
  113.         $this->discount $discount;
  114.         return $this;
  115.     }
  116.     public function getPrice(): ?string
  117.     {
  118.         return $this->price;
  119.     }
  120.     public function setPrice(?string $price): self
  121.     {
  122.         $this->price $price;
  123.         return $this;
  124.     }
  125.     /**
  126.      * @return Collection<int, OfferGeneratorPriceListGroupItem>
  127.      */
  128.     public function getPriceListItems(): Collection
  129.     {
  130.         return $this->priceListItems;
  131.     }
  132.     public function addPriceListItem(OfferGeneratorPriceListGroupItem $priceListItem): self
  133.     {
  134.         if (!$this->priceListItems->contains($priceListItem)) {
  135.             $this->priceListItems->add($priceListItem);
  136.         }
  137.         return $this;
  138.     }
  139.     public function removePriceListItem(OfferGeneratorPriceListGroupItem $priceListItem): self
  140.     {
  141.         $this->priceListItems->removeElement($priceListItem);
  142.         return $this;
  143.     }
  144.     public function getCategory(): ?OnlineServiceCategory
  145.     {
  146.         return $this->category;
  147.     }
  148.     public function setCategory(?OnlineServiceCategory $category): self
  149.     {
  150.         $this->category $category;
  151.         return $this;
  152.     }
  153. }