src/Entity/BusinessClient.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\BusinessClient\ContactPerson;
  4. use App\Entity\BusinessClient\PriceRange;
  5. use App\Repository\BusinessClientRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. /**
  10.  * @ORM\Entity(repositoryClass=BusinessClientRepository::class)
  11.  */
  12. class BusinessClient
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=1024)
  22.      */
  23.     private $name;
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      */
  27.     private $RFC;
  28.     /**
  29.      * @ORM\Column(type="string", length=255)
  30.      */
  31.     private $phone;
  32.     /**
  33.      * @ORM\Column(type="string", length=255)
  34.      */
  35.     private $email;
  36.     /**
  37.      * @ORM\OneToMany(targetEntity=ContactPerson::class, mappedBy="businessClient", cascade={"persist", "remove"})
  38.      */
  39.     private $contactPeople;
  40.     /**
  41.      * @ORM\OneToMany(targetEntity=PriceRange::class, mappedBy="BusinessClient", cascade={"persist","remove"})
  42.      */
  43.     private $priceRanges;
  44.     /**
  45.      * @ORM\OneToMany(targetEntity=Shipping::class, mappedBy="businessClient")
  46.      */
  47.     private $shippings;
  48.     public function __construct()
  49.     {
  50.         $this->contactPeople = new ArrayCollection();
  51.         $this->priceRanges = new ArrayCollection();
  52.         $this->shippings = new ArrayCollection();
  53.     }
  54.     public function getId(): ?int
  55.     {
  56.         return $this->id;
  57.     }
  58.     public function getName(): ?string
  59.     {
  60.         return $this->name;
  61.     }
  62.     public function setName(string $name): self
  63.     {
  64.         $this->name $name;
  65.         return $this;
  66.     }
  67.     public function getRFC(): ?string
  68.     {
  69.         return $this->RFC;
  70.     }
  71.     public function setRFC(string $RFC): self
  72.     {
  73.         $this->RFC $RFC;
  74.         return $this;
  75.     }
  76.     public function getPhone(): ?string
  77.     {
  78.         return $this->phone;
  79.     }
  80.     public function setPhone(string $phone): self
  81.     {
  82.         $this->phone $phone;
  83.         return $this;
  84.     }
  85.     public function getEmail(): ?string
  86.     {
  87.         return $this->email;
  88.     }
  89.     public function setEmail(string $email): self
  90.     {
  91.         $this->email $email;
  92.         return $this;
  93.     }
  94.     /**
  95.      * @return Collection<int, ContactPerson>
  96.      */
  97.     public function getContactPeople(): Collection
  98.     {
  99.         return $this->contactPeople;
  100.     }
  101.     public function addContactPerson(ContactPerson $contactPerson): self
  102.     {
  103.         if (!$this->contactPeople->contains($contactPerson)) {
  104.             $this->contactPeople[] = $contactPerson;
  105.             $contactPerson->setBusinessClient($this);
  106.         }
  107.         return $this;
  108.     }
  109.     public function removeContactPerson(ContactPerson $contactPerson): self
  110.     {
  111.         if ($this->contactPeople->removeElement($contactPerson)) {
  112.             // set the owning side to null (unless already changed)
  113.             if ($contactPerson->getBusinessClient() === $this) {
  114.                 $contactPerson->setBusinessClient(null);
  115.             }
  116.         }
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return Collection<int, PriceRange>
  121.      */
  122.     public function getPriceRanges(): Collection
  123.     {
  124.         return $this->priceRanges;
  125.     }
  126.     public function addPriceRange(PriceRange $priceRange): self
  127.     {
  128.         if (!$this->priceRanges->contains($priceRange)) {
  129.             $this->priceRanges[] = $priceRange;
  130.             $priceRange->setBusinessClient($this);
  131.         }
  132.         return $this;
  133.     }
  134.     public function removePriceRange(PriceRange $priceRange): self
  135.     {
  136.         if ($this->priceRanges->removeElement($priceRange)) {
  137.             // set the owning side to null (unless already changed)
  138.             if ($priceRange->getBusinessClient() === $this) {
  139.                 $priceRange->setBusinessClient(null);
  140.             }
  141.         }
  142.         return $this;
  143.     }
  144.     /**
  145.      * @return Collection<int, Shipping>
  146.      */
  147.     public function getShippings(): Collection
  148.     {
  149.         return $this->shippings;
  150.     }
  151.     public function addShipping(Shipping $shipping): self
  152.     {
  153.         if (!$this->shippings->contains($shipping)) {
  154.             $this->shippings[] = $shipping;
  155.             $shipping->setBusinessClient($this);
  156.         }
  157.         return $this;
  158.     }
  159.     public function removeShipping(Shipping $shipping): self
  160.     {
  161.         if ($this->shippings->removeElement($shipping)) {
  162.             // set the owning side to null (unless already changed)
  163.             if ($shipping->getBusinessClient() === $this) {
  164.                 $shipping->setBusinessClient(null);
  165.             }
  166.         }
  167.         return $this;
  168.     }
  169. }