<?php
namespace App\Entity\System;
use Doctrine\ORM\Mapping as ORM;
/**
* CatalogProduct
*
* @ORM\Table(name="product_catalog",
* indexes={
*
* @ORM\Index(name="catalog_id", columns={"catalog_id"}),
* @ORM\Index(name="product_id", columns={"product_id"}),
* @ORM\Index(name="date_add", columns={"date_add"})
* }
* ,uniqueConstraints={@ORM\UniqueConstraint(name="catalog_product_idx", columns={"catalog_id", "product_id"})}
* )
*
* @ORM\Entity(repositoryClass="App\Repository\System\ProductCatalogRepository")
*/
class ProductCatalog
{
/**
* @var int
*
* @ORM\Id
*
* @ORM\GeneratedValue(strategy="AUTO")
*
* @ORM\Column(type="integer")
*/
private $id;
/**
* @var Catalog
*
* @ORM\ManyToOne(targetEntity="App\Entity\System\Catalog", inversedBy="productCatalogs")
*
* @ORM\JoinColumn(nullable=false, name="catalog_id", referencedColumnName="id")
*/
private $catalog;
/**
* @var Product
*
* @ORM\ManyToOne(targetEntity="App\Entity\System\Product" , inversedBy="productCatalogs")
*
* @ORM\JoinColumn(nullable=false, name="product_id", referencedColumnName="id_product")
*/
private $product;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime")
*/
private $dateAdd;
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @param int $id
*
* @return ProductCatalog
*/
public function setId(int $id): self
{
$this->id = $id;
return $this;
}
/**
* @return Catalog
*/
public function getCatalog(): Catalog
{
return $this->catalog;
}
/**
* @param Catalog $catalog
*
* @return ProductCatalog
*/
public function setCatalog(Catalog $catalog): self
{
$this->catalog = $catalog;
return $this;
}
/**
* @return Product
*/
public function getProduct(): Product
{
return $this->product;
}
/**
* @param Product $product
*
* @return ProductCatalog
*/
public function setProduct(Product $product): self
{
$this->product = $product;
return $this;
}
/**
* @return \DateTime
*/
public function getDateAdd(): \DateTime
{
return $this->dateAdd;
}
/**
* @param \DateTime $dateAdd
*
* @return ProductCatalog
*/
public function setDateAdd(\DateTime $dateAdd): self
{
$this->dateAdd = $dateAdd;
return $this;
}
}