src/Entity/FiscalWarehouse.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\FiscalWarehouse\ContactPerson;
  4. use App\Repository\FiscalWarehourseRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=FiscalWarehourseRepository::class)
  10.  */
  11. class FiscalWarehouse
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $name;
  23.     /**
  24.      * @ORM\Column(type="boolean")
  25.      */
  26.     private $enabled;
  27.     /**
  28.      * @ORM\Column(type="string", length=255)
  29.      */
  30.     private $number;
  31.     /**
  32.      * @ORM\Column(type="string", length=1024)
  33.      */
  34.     private $airport;
  35.     /**
  36.      * @ORM\OneToMany(targetEntity=ContactPerson::class, mappedBy="fiscalWarehouse", cascade={"persist","remove"})
  37.      */
  38.     private $contactPeople;
  39.     public function __construct()
  40.     {
  41.         $this->contactPeople = new ArrayCollection();
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getName(): ?string
  48.     {
  49.         return $this->name;
  50.     }
  51.     public function setName(string $name): self
  52.     {
  53.         $this->name $name;
  54.         return $this;
  55.     }
  56.     public function isEnabled(): ?bool
  57.     {
  58.         return $this->enabled;
  59.     }
  60.     public function setEnabled(bool $enabled): self
  61.     {
  62.         $this->enabled $enabled;
  63.         return $this;
  64.     }
  65.     public function getNumber(): ?string
  66.     {
  67.         return $this->number;
  68.     }
  69.     public function setNumber(string $number): self
  70.     {
  71.         $this->number $number;
  72.         return $this;
  73.     }
  74.     public function getAirport(): ?string
  75.     {
  76.         return $this->airport;
  77.     }
  78.     public function setAirport(string $airport): self
  79.     {
  80.         $this->airport $airport;
  81.         return $this;
  82.     }
  83.     /**
  84.      * @return Collection<int, ContactPerson>
  85.      */
  86.     public function getContactPeople(): Collection
  87.     {
  88.         return $this->contactPeople;
  89.     }
  90.     public function addContactPerson(ContactPerson $contactPerson): self
  91.     {
  92.         if (!$this->contactPeople->contains($contactPerson)) {
  93.             $this->contactPeople[] = $contactPerson;
  94.             $contactPerson->setFiscalWarehouse($this);
  95.         }
  96.         return $this;
  97.     }
  98.     public function removeContactPerson(ContactPerson $contactPerson): self
  99.     {
  100.         if ($this->contactPeople->removeElement($contactPerson)) {
  101.             // set the owning side to null (unless already changed)
  102.             if ($contactPerson->getFiscalWarehouse() === $this) {
  103.                 $contactPerson->setFiscalWarehouse(null);
  104.             }
  105.         }
  106.         return $this;
  107.     }
  108. }