<?php
namespace App\Entity\Quote;
use App\Repository\Quote\ClientRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ClientRepository::class)
*/
class Client
{
/**
* @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 $phone;
/**
* @ORM\Column(type="string", length=255)
*/
private $email;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $rfc;
/**
* @ORM\OneToMany(targetEntity=Quote::class, mappedBy="client")
*/
private $quotes;
public function __construct()
{
$this->quotes = 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 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;
}
public function getRfc(): ?string
{
return $this->rfc;
}
public function setRfc(?string $rfc): self
{
$this->rfc = $rfc;
return $this;
}
/**
* @return Collection<int, Quote>
*/
public function getQuotes(): Collection
{
return $this->quotes;
}
public function addQuote(Quote $quote): self
{
if (!$this->quotes->contains($quote)) {
$this->quotes[] = $quote;
$quote->setClient($this);
}
return $this;
}
public function removeQuote(Quote $quote): self
{
if ($this->quotes->removeElement($quote)) {
// set the owning side to null (unless already changed)
if ($quote->getClient() === $this) {
$quote->setClient(null);
}
}
return $this;
}
public function __toString()
{
return $this->name;
}
}