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.     /**
  26.      * @var int
  27.      *
  28.      * @ORM\Column(type="integer")
  29.      *
  30.      * @ORM\Id
  31.      *
  32.      * @ORM\GeneratedValue(strategy="AUTO")
  33.      */
  34.     private $id;
  35.     /**
  36.      * @var string
  37.      *
  38.      * @ORM\Column(type="string")
  39.      */
  40.     private $name;
  41.     /**
  42.      * @var string
  43.      *
  44.      * @ORM\Column(type="string", length=100)
  45.      */
  46.     private $reference;
  47.     /**
  48.      * @var \DateTime
  49.      *
  50.      * @ORM\Column(type="datetime")
  51.      */
  52.     private $dateAdd;
  53.     /**
  54.      * @ORM\OneToMany(targetEntity="App\Entity\System\ProductCatalog", mappedBy="catalog", orphanRemoval=true)
  55.      */
  56.     private $productCatalogs;
  57.     /**
  58.      * @ORM\OneToMany(targetEntity="App\Entity\System\CustomerCatalog", mappedBy="catalog", orphanRemoval=true)
  59.      */
  60.     private $customerCatalogs;
  61.     public function __construct()
  62.     {
  63.         $this->productCatalogs = new ArrayCollection();
  64.         $this->customerCatalogs = new ArrayCollection();
  65.         $this->dateAdd = new \DateTime();
  66.     }
  67.     /**
  68.      * @return int
  69.      */
  70.     public function getId(): int
  71.     {
  72.         return $this->id;
  73.     }
  74.     /**
  75.      * @param int $id
  76.      *
  77.      * @return Catalog
  78.      */
  79.     public function setId(int $id): self
  80.     {
  81.         $this->id $id;
  82.         return $this;
  83.     }
  84.     /**
  85.      * @return string
  86.      */
  87.     public function getName(): string
  88.     {
  89.         return $this->name;
  90.     }
  91.     /**
  92.      * @param string $name
  93.      *
  94.      * @return Catalog
  95.      */
  96.     public function setName(string $name): self
  97.     {
  98.         $this->name $name;
  99.         return $this;
  100.     }
  101.     /**
  102.      * @return string
  103.      */
  104.     public function getReference(): string
  105.     {
  106.         return $this->reference;
  107.     }
  108.     /**
  109.      * @param string $reference
  110.      *
  111.      * @return Catalog
  112.      */
  113.     public function setReference(string $reference): self
  114.     {
  115.         $this->reference $reference;
  116.         return $this;
  117.     }
  118.     /**
  119.      * @return \DateTime
  120.      */
  121.     public function getDateAdd(): \DateTime
  122.     {
  123.         return $this->dateAdd;
  124.     }
  125.     /**
  126.      * @param \DateTime $dateAdd
  127.      *
  128.      * @return Catalog
  129.      */
  130.     public function setDateAdd(\DateTime $dateAdd): self
  131.     {
  132.         $this->dateAdd $dateAdd;
  133.         return $this;
  134.     }
  135.     /**
  136.      * @return ArrayCollection
  137.      */
  138.     public function getProductCatalogs(): ArrayCollection
  139.     {
  140.         return $this->productCatalogs;
  141.     }
  142.     /**
  143.      * @param ArrayCollection $productCatalogs
  144.      *
  145.      * @return Catalog
  146.      */
  147.     public function setProductCatalogs(ArrayCollection $productCatalogs): self
  148.     {
  149.         $this->productCatalogs $productCatalogs;
  150.         return $this;
  151.     }
  152.     /**
  153.      * @return mixed
  154.      */
  155.     public function getCustomerCatalogs()
  156.     {
  157.         return $this->customerCatalogs;
  158.     }
  159.     /**
  160.      * @param mixed $customerCatalogs
  161.      */
  162.     public function setCustomerCatalogs($customerCatalogs): self
  163.     {
  164.         $this->customerCatalogs $customerCatalogs;
  165.         return $this;
  166.     }
  167. }