<?php
namespace App\Entity;
use App\Repository\StoreCentralPurchasingRelationRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity(repositoryClass=StoreCentralPurchasingRelationRepository::class)
* @ORM\EntityListeners({"App\Listener\StoreCentralPurchasingRelationListener"})
* @UniqueEntity(
* fields={"store", "centralPurchasing"},
* message="Cette relation existe déjà"
* )
*/
class StoreCentralPurchasingRelation
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Store::class, inversedBy="storeCentralPurchasingRelations")
* @ORM\JoinColumn(nullable=false)
*/
private $store;
/**
* @ORM\ManyToOne(targetEntity=CentralPurchasing::class, inversedBy="storeCentralPurchasingRelations")
* @ORM\JoinColumn(nullable=false)
*/
private $centralPurchasing;
/**
* @ORM\Column(type="boolean")
*/
private $enabled=1;
public function getId(): ?int
{
return $this->id;
}
public function getStore(): ?Store
{
return $this->store;
}
public function setStore(?Store $store): self
{
$this->store = $store;
return $this;
}
public function getCentralPurchasing(): ?CentralPurchasing
{
return $this->centralPurchasing;
}
public function setCentralPurchasing(?CentralPurchasing $centralPurchasing): self
{
$this->centralPurchasing = $centralPurchasing;
return $this;
}
public function getEnabled(): ?bool
{
return $this->enabled;
}
public function isEnabled(): ?bool
{
return $this->getEnabled();
}
public function setEnabled(bool $enabled): self
{
$this->enabled = $enabled;
return $this;
}
}