<?php
namespace App\Entity;
use App\Entity\BusinessClient\ContactPerson;
use App\Entity\BusinessClient\PriceRange;
use App\Repository\BusinessClientRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=BusinessClientRepository::class)
*/
class BusinessClient
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=1024)
*/
private $name;
/**
* @ORM\Column(type="string", length=255)
*/
private $RFC;
/**
* @ORM\Column(type="string", length=255)
*/
private $phone;
/**
* @ORM\Column(type="string", length=255)
*/
private $email;
/**
* @ORM\OneToMany(targetEntity=ContactPerson::class, mappedBy="businessClient", cascade={"persist", "remove"})
*/
private $contactPeople;
/**
* @ORM\OneToMany(targetEntity=PriceRange::class, mappedBy="BusinessClient", cascade={"persist","remove"})
*/
private $priceRanges;
/**
* @ORM\OneToMany(targetEntity=Shipping::class, mappedBy="businessClient")
*/
private $shippings;
public function __construct()
{
$this->contactPeople = new ArrayCollection();
$this->priceRanges = new ArrayCollection();
$this->shippings = 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 getRFC(): ?string
{
return $this->RFC;
}
public function setRFC(string $RFC): self
{
$this->RFC = $RFC;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
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->setBusinessClient($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->getBusinessClient() === $this) {
$contactPerson->setBusinessClient(null);
}
}
return $this;
}
/**
* @return Collection<int, PriceRange>
*/
public function getPriceRanges(): Collection
{
return $this->priceRanges;
}
public function addPriceRange(PriceRange $priceRange): self
{
if (!$this->priceRanges->contains($priceRange)) {
$this->priceRanges[] = $priceRange;
$priceRange->setBusinessClient($this);
}
return $this;
}
public function removePriceRange(PriceRange $priceRange): self
{
if ($this->priceRanges->removeElement($priceRange)) {
// set the owning side to null (unless already changed)
if ($priceRange->getBusinessClient() === $this) {
$priceRange->setBusinessClient(null);
}
}
return $this;
}
/**
* @return Collection<int, Shipping>
*/
public function getShippings(): Collection
{
return $this->shippings;
}
public function addShipping(Shipping $shipping): self
{
if (!$this->shippings->contains($shipping)) {
$this->shippings[] = $shipping;
$shipping->setBusinessClient($this);
}
return $this;
}
public function removeShipping(Shipping $shipping): self
{
if ($this->shippings->removeElement($shipping)) {
// set the owning side to null (unless already changed)
if ($shipping->getBusinessClient() === $this) {
$shipping->setBusinessClient(null);
}
}
return $this;
}
}