<?php
namespace App\Entity\Application;
use App\Entity\Product;
use App\Entity\Dealer;
use App\Repository\Application\AppProductRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=AppProductRepository::class)
*/
class AppProduct
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\OneToOne(targetEntity=Product::class, cascade={"persist"})
* @ORM\JoinColumn(nullable=false)
*/
private $product;
/**
* @ORM\ManyToOne(targetEntity=Category::class)
*/
private $category;
/**
* @ORM\ManyToOne(targetEntity=Dealer::class, inversedBy="appProducts")
*/
private $dealer;
public function getId(): ?int
{
return $this->id;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(Product $product): self
{
$this->product = $product;
return $this;
}
public function getCategory(): ?Category
{
return $this->category;
}
public function setCategory(?Category $category): self
{
$this->category = $category;
return $this;
}
/**
* Get Dealer
*
* @return mixed
*/
public function getDealer()
{
return $this->dealer;
}
/**
* Set Dealer
*
* @param mixed $dealer
*/
public function setDealer( $dealer )
{
$this->dealer = $dealer;
}
}