<?php
namespace App\Entity;
use App\Entity\FiscalWarehouse\ContactPerson;
use App\Repository\FiscalWarehourseRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=FiscalWarehourseRepository::class)
*/
class FiscalWarehouse
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="boolean")
*/
private $enabled;
/**
* @ORM\Column(type="string", length=255)
*/
private $number;
/**
* @ORM\Column(type="string", length=1024)
*/
private $airport;
/**
* @ORM\OneToMany(targetEntity=ContactPerson::class, mappedBy="fiscalWarehouse", cascade={"persist","remove"})
*/
private $contactPeople;
public function __construct()
{
$this->contactPeople = 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;
}
public function isEnabled(): ?bool
{
return $this->enabled;
}
public function setEnabled(bool $enabled): self
{
$this->enabled = $enabled;
return $this;
}
public function getNumber(): ?string
{
return $this->number;
}
public function setNumber(string $number): self
{
$this->number = $number;
return $this;
}
public function getAirport(): ?string
{
return $this->airport;
}
public function setAirport(string $airport): self
{
$this->airport = $airport;
return $this;
}
/**
* @return Collection<int, ContactPerson>
*/
public function getContactPeople(): Collection
{
return $this->contactPeople;
}
public function addContactPerson(ContactPerson $contactPerson): self
{
if (!$this->contactPeople->contains($contactPerson)) {
$this->contactPeople[] = $contactPerson;
$contactPerson->setFiscalWarehouse($this);
}
return $this;
}
public function removeContactPerson(ContactPerson $contactPerson): self
{
if ($this->contactPeople->removeElement($contactPerson)) {
// set the owning side to null (unless already changed)
if ($contactPerson->getFiscalWarehouse() === $this) {
$contactPerson->setFiscalWarehouse(null);
}
}
return $this;
}
}