<?php
namespace App\Entity\System;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* Catalog
*
* @ORM\Table(name="catalog",
* indexes={
*
* @ORM\Index(name="name", columns={"name"}),
* @ORM\Index(name="reference", columns={"reference"}),
* @ORM\Index(name="date_add", columns={"date_add"})
* }
* )
*
* @ORM\Entity(repositoryClass="App\Repository\System\CatalogRepository")
*/
class Catalog
{
public const CATALOG_ID_GENERAL_BIGBUY = 1;
public const DEFAULT_CATALOG_BIGBUY_REFERENCE = 'BIGBUY';
public const CATALOG_ID_CECOTEC_D2C = 28;
public const CATALOG_ID_TORNASOL_D2C = 41;
/**
* @var int
*
* @ORM\Column(type="integer")
*
* @ORM\Id
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(type="string")
*/
private $name;
/**
* @var string
*
* @ORM\Column(type="string", length=100)
*/
private $reference;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime")
*/
private $dateAdd;
/**
* @ORM\OneToMany(targetEntity="App\Entity\System\ProductCatalog", mappedBy="catalog", orphanRemoval=true)
*/
private $productCatalogs;
/**
* @ORM\OneToMany(targetEntity="App\Entity\System\CustomerCatalog", mappedBy="catalog", orphanRemoval=true)
*/
private $customerCatalogs;
public function __construct()
{
$this->productCatalogs = new ArrayCollection();
$this->customerCatalogs = new ArrayCollection();
$this->dateAdd = new \DateTime();
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @param int $id
*
* @return Catalog
*/
public function setId(int $id): self
{
$this->id = $id;
return $this;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @param string $name
*
* @return Catalog
*/
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
/**
* @return string
*/
public function getReference(): string
{
return $this->reference;
}
/**
* @param string $reference
*
* @return Catalog
*/
public function setReference(string $reference): self
{
$this->reference = $reference;
return $this;
}
/**
* @return \DateTime
*/
public function getDateAdd(): \DateTime
{
return $this->dateAdd;
}
/**
* @param \DateTime $dateAdd
*
* @return Catalog
*/
public function setDateAdd(\DateTime $dateAdd): self
{
$this->dateAdd = $dateAdd;
return $this;
}
/**
* @return ArrayCollection
*/
public function getProductCatalogs(): ArrayCollection
{
return $this->productCatalogs;
}
/**
* @param ArrayCollection $productCatalogs
*
* @return Catalog
*/
public function setProductCatalogs(ArrayCollection $productCatalogs): self
{
$this->productCatalogs = $productCatalogs;
return $this;
}
/**
* @return mixed
*/
public function getCustomerCatalogs()
{
return $this->customerCatalogs;
}
/**
* @param mixed $customerCatalogs
*/
public function setCustomerCatalogs($customerCatalogs): self
{
$this->customerCatalogs = $customerCatalogs;
return $this;
}
}