<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(
* uniqueConstraints={@ORM\UniqueConstraint(name="combination", columns={"hash", "product_id"})}
* )
* @ORM\Entity(repositoryClass="App\Repository\RecentlyProductRepository")
*/
class RecentlyProduct
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=100)
*/
private $hash;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Product", cascade={"MERGE"} )
* @ORM\JoinColumn(nullable=false)
*/
private $product;
/**
* @ORM\Column(type="datetime")
*/
private $createts;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Client", inversedBy="recentlyProducts")
*/
private $client;
public function getId(): ?int
{
return $this->id;
}
public function getHash(): ?string
{
return $this->hash;
}
public function setHash(string $hash): self
{
$this->hash = $hash;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): self
{
$this->product = $product;
return $this;
}
public function getCreatets(): ?\DateTimeInterface
{
return $this->createts;
}
public function setCreatets(\DateTimeInterface $createts): self
{
$this->createts = $createts;
return $this;
}
public function getClient(): ?Client
{
return $this->client;
}
public function setClient(?Client $client): self
{
$this->client = $client;
return $this;
}
}