src/AtechNet/CoreBundle/Entity/ProductGroup.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\AtechNet\CoreBundle\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping\Column;
  5. use Doctrine\ORM\Mapping\Entity;
  6. use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
  7. use Doctrine\ORM\Mapping\JoinColumn;
  8. use Doctrine\ORM\Mapping\ManyToOne;
  9. use Doctrine\ORM\Mapping\OneToMany;
  10. use Doctrine\ORM\Mapping\Table;
  11. /**
  12.  * ProductGroup
  13.  *
  14.  * @Table(name="product_group")
  15.  * @Entity
  16.  * @HasLifecycleCallbacks
  17.  */
  18. class ProductGroup extends AbstractSignedEntity
  19. {
  20.     /**
  21.      * @var Domain
  22.      *
  23.      * @ManyToOne(targetEntity="Domain")
  24.      * @JoinColumn(name="domain_id", referencedColumnName="id")
  25.      */
  26.     private $domain;
  27.     /**
  28.      * @var string
  29.      *
  30.      * @Column(name="title", type="string", length=64)
  31.      */
  32.     private $title;
  33.     /**
  34.      * @var int
  35.      *
  36.      * @Column(name="products_to_display", type="integer")
  37.      */
  38.     private $productsToDisplay;
  39.     /**
  40.      * @var bool
  41.      *
  42.      * @Column(name="only_flash_sales", type="boolean")
  43.      */
  44.     private $onlyFlashSales = false;
  45.     /**
  46.      * @var ArrayCollection
  47.      *
  48.      * @OneToMany(targetEntity="ProductGroupMember", mappedBy="group", orphanRemoval=true)
  49.      **/
  50.     private $members;
  51.     /**
  52.      * @var bool
  53.      *
  54.      * @Column(name="show_random", type="boolean")
  55.      */
  56.     private $showRandom = false;
  57.     /**
  58.      * @return Domain
  59.      */
  60.     public function getDomain()
  61.     {
  62.         return $this->domain;
  63.     }
  64.     /**
  65.      * @param Domain $domain
  66.      */
  67.     public function setDomain($domain)
  68.     {
  69.         $this->domain = $domain;
  70.     }
  71.     /**
  72.      * @return string
  73.      */
  74.     public function getTitle()
  75.     {
  76.         return $this->title;
  77.     }
  78.     /**
  79.      * @param string $title
  80.      */
  81.     public function setTitle($title)
  82.     {
  83.         $this->title = $title;
  84.     }
  85.     /**
  86.      * @return int
  87.      */
  88.     public function getProductsToDisplay()
  89.     {
  90.         return $this->productsToDisplay;
  91.     }
  92.     /**
  93.      * @param int $productsToDisplay
  94.      */
  95.     public function setProductsToDisplay($productsToDisplay)
  96.     {
  97.         $this->productsToDisplay = $productsToDisplay;
  98.     }
  99.     /**
  100.      * @return bool
  101.      */
  102.     public function isOnlyFlashSales()
  103.     {
  104.         return $this->onlyFlashSales;
  105.     }
  106.     /**
  107.      * @param bool $onlyFlashSales
  108.      */
  109.     public function setOnlyFlashSales($onlyFlashSales)
  110.     {
  111.         $this->onlyFlashSales = $onlyFlashSales;
  112.     }
  113.     /**
  114.      * @return ArrayCollection
  115.      */
  116.     public function getMembers()
  117.     {
  118.         return $this->members;
  119.     }
  120.     /**
  121.      * @param ArrayCollection $members
  122.      */
  123.     public function setMembers($members)
  124.     {
  125.         $this->members = $members;
  126.     }
  127.     /**
  128.      * @return void
  129.      */
  130.     public function removeAllMember(): void
  131.     {
  132.         $this->members->clear();
  133.     }
  134.     /**
  135.      * @return bool
  136.      */
  137.     public function getShowRandom(): bool
  138.     {
  139.         return $this->showRandom;
  140.     }
  141.     /**
  142.      * @param bool $showRandom
  143.      * @return void
  144.      */
  145.     public function setShowRandom(bool $showRandom): void
  146.     {
  147.         $this->showRandom = $showRandom;
  148.     }
  149. }