src/Entity/Consignee.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Documentation\MasterGuide;
  4. use App\Repository\ConsigneeRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=ConsigneeRepository::class)
  10.  */
  11. class Consignee
  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="text")
  25.      */
  26.     private $address;
  27.     /**
  28.      * @ORM\Column(type="string", length=255)
  29.      */
  30.     private $phone;
  31.     /**
  32.      * @ORM\OneToMany(targetEntity=MasterGuide::class, mappedBy="consignee")
  33.      */
  34.     private $masterGuides;
  35.     /**
  36.      * @ORM\Column(type="string", length=255)
  37.      */
  38.     private $contactEmail;
  39.     public function __construct()
  40.     {
  41.         $this->masterGuides = 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 getAddress(): ?string
  57.     {
  58.         return $this->address;
  59.     }
  60.     public function setAddress(string $address): self
  61.     {
  62.         $this->address $address;
  63.         return $this;
  64.     }
  65.     public function getPhone(): ?string
  66.     {
  67.         return $this->phone;
  68.     }
  69.     public function setPhone(string $phone): self
  70.     {
  71.         $this->phone $phone;
  72.         return $this;
  73.     }
  74.     /**
  75.      * @return Collection<int, MasterGuide>
  76.      */
  77.     public function getMasterGuides(): Collection
  78.     {
  79.         return $this->masterGuides;
  80.     }
  81.     public function addMasterGuide(MasterGuide $masterGuide): self
  82.     {
  83.         if (!$this->masterGuides->contains($masterGuide)) {
  84.             $this->masterGuides[] = $masterGuide;
  85.             $masterGuide->setConsignee($this);
  86.         }
  87.         return $this;
  88.     }
  89.     public function removeMasterGuide(MasterGuide $masterGuide): self
  90.     {
  91.         if ($this->masterGuides->removeElement($masterGuide)) {
  92.             // set the owning side to null (unless already changed)
  93.             if ($masterGuide->getConsignee() === $this) {
  94.                 $masterGuide->setConsignee(null);
  95.             }
  96.         }
  97.         return $this;
  98.     }
  99.     public function getContactEmail(): ?string
  100.     {
  101.         return $this->contactEmail;
  102.     }
  103.     public function setContactEmail(string $contactEmail): self
  104.     {
  105.         $this->contactEmail $contactEmail;
  106.         return $this;
  107.     }
  108. }