src/Entity/System/Catalog.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * Catalog
  7.  *
  8.  * @ORM\Table(name="catalog",
  9.  *     indexes={
  10.  *
  11.  *     @ORM\Index(name="name", columns={"name"}),
  12.  *     @ORM\Index(name="reference", columns={"reference"}),
  13.  *     @ORM\Index(name="date_add", columns={"date_add"})
  14.  *     }
  15.  *     )
  16.  *
  17.  * @ORM\Entity(repositoryClass="App\Repository\System\CatalogRepository")
  18.  */
  19. class Catalog
  20. {
  21.     public const CATALOG_ID_GENERAL_BIGBUY 1;
  22.     public const DEFAULT_CATALOG_BIGBUY_REFERENCE 'BIGBUY';
  23.     public const CATALOG_ID_CECOTEC_D2C 28;
  24.     public const CATALOG_ID_TORNASOL_D2C 41;
  25.     public const CATALOG_ID_EMPLOYEE 47;
  26.     /**
  27.      * @var int
  28.      *
  29.      * @ORM\Column(type="integer")
  30.      *
  31.      * @ORM\Id
  32.      *
  33.      * @ORM\GeneratedValue(strategy="AUTO")
  34.      */
  35.     private $id;
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(type="string")
  40.      */
  41.     private $name;
  42.     /**
  43.      * @var string
  44.      *
  45.      * @ORM\Column(type="string", length=100)
  46.      */
  47.     private $reference;
  48.     /**
  49.      * @var \DateTime
  50.      *
  51.      * @ORM\Column(type="datetime")
  52.      */
  53.     private $dateAdd;
  54.     /**
  55.      * @ORM\OneToMany(targetEntity="App\Entity\System\ProductCatalog", mappedBy="catalog", orphanRemoval=true)
  56.      */
  57.     private $productCatalogs;
  58.     /**
  59.      * @ORM\OneToMany(targetEntity="App\Entity\System\CustomerCatalog", mappedBy="catalog", orphanRemoval=true)
  60.      */
  61.     private $customerCatalogs;
  62.     public function __construct()
  63.     {
  64.         $this->productCatalogs = new ArrayCollection();
  65.         $this->customerCatalogs = new ArrayCollection();
  66.         $this->dateAdd = new \DateTime();
  67.     }
  68.     /**
  69.      * @return int
  70.      */
  71.     public function getId(): int
  72.     {
  73.         return $this->id;
  74.     }
  75.     /**
  76.      * @param int $id
  77.      *
  78.      * @return Catalog
  79.      */
  80.     public function setId(int $id): self
  81.     {
  82.         $this->id $id;
  83.         return $this;
  84.     }
  85.     /**
  86.      * @return string
  87.      */
  88.     public function getName(): string
  89.     {
  90.         return $this->name;
  91.     }
  92.     /**
  93.      * @param string $name
  94.      *
  95.      * @return Catalog
  96.      */
  97.     public function setName(string $name): self
  98.     {
  99.         $this->name $name;
  100.         return $this;
  101.     }
  102.     /**
  103.      * @return string
  104.      */
  105.     public function getReference(): string
  106.     {
  107.         return $this->reference;
  108.     }
  109.     /**
  110.      * @param string $reference
  111.      *
  112.      * @return Catalog
  113.      */
  114.     public function setReference(string $reference): self
  115.     {
  116.         $this->reference $reference;
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return \DateTime
  121.      */
  122.     public function getDateAdd(): \DateTime
  123.     {
  124.         return $this->dateAdd;
  125.     }
  126.     /**
  127.      * @param \DateTime $dateAdd
  128.      *
  129.      * @return Catalog
  130.      */
  131.     public function setDateAdd(\DateTime $dateAdd): self
  132.     {
  133.         $this->dateAdd $dateAdd;
  134.         return $this;
  135.     }
  136.     /**
  137.      * @return ArrayCollection
  138.      */
  139.     public function getProductCatalogs(): ArrayCollection
  140.     {
  141.         return $this->productCatalogs;
  142.     }
  143.     /**
  144.      * @param ArrayCollection $productCatalogs
  145.      *
  146.      * @return Catalog
  147.      */
  148.     public function setProductCatalogs(ArrayCollection $productCatalogs): self
  149.     {
  150.         $this->productCatalogs $productCatalogs;
  151.         return $this;
  152.     }
  153.     /**
  154.      * @return mixed
  155.      */
  156.     public function getCustomerCatalogs()
  157.     {
  158.         return $this->customerCatalogs;
  159.     }
  160.     /**
  161.      * @param mixed $customerCatalogs
  162.      */
  163.     public function setCustomerCatalogs($customerCatalogs): self
  164.     {
  165.         $this->customerCatalogs $customerCatalogs;
  166.         return $this;
  167.     }
  168. }