<?php
namespace App\Entity;
use App\Repository\EstablishmentStatusRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=EstablishmentStatusRepository::class)
* Customer/Fournisseur/Negocient
*/
class EstablishmentStatus
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\OneToMany(targetEntity=Establishments::class, mappedBy="status")
*/
private $establishments;
public function __construct()
{
$this->establishments = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
/**
* @return Collection<int, Establishments>
*/
public function getEstablishments(): Collection
{
return $this->establishments;
}
public function addEstablishment(Establishments $establishment): self
{
if (!$this->establishments->contains($establishment)) {
$this->establishments[] = $establishment;
$establishment->setStatus($this);
}
return $this;
}
public function removeEstablishment(Establishments $establishment): self
{
if ($this->establishments->removeElement($establishment)) {
// set the owning side to null (unless already changed)
if ($establishment->getStatus() === $this) {
$establishment->setStatus(null);
}
}
return $this;
}
}