<?php
namespace App\Entity;
use App\Repository\ProductClickRepository;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\JoinColumn;
use Doctrine\ORM\Mapping\ManyToOne;
#[ORM\Entity(repositoryClass: ProductClickRepository::class)]
class ProductClick
{
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: 'integer', unique: true)]
private $id;
#[ORM\Column(type: 'date')]
private $date;
#[ORM\ManyToOne(targetEntity: Product::class, inversedBy: 'productclicks')]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
private $product;
#[ORM\Column(type: 'integer')]
private $number;
#[ORM\ManyToOne(targetEntity: Company::class,inversedBy: 'productclicks')]
#[ORM\JoinColumn(nullable: false,onDelete: 'CASCADE')]
private $company;
public function getCompany(): ?int
{
return $this->company->getId();
}
public function setCompany(?Company $company): self
{
$this->company = $company;
return $this;
}
public function getProduct(): ?int
{
return $this->product->getId();
}
public function setProduct(?Product $product): self
{
$this->product = $product;
return $this;
}
public function getId(): ?int
{
return $this->id;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getNumber(): ?int
{
return $this->number;
}
public function setNumber(int $number): self
{
$this->number = $number;
return $this;
}
}