<?php
namespace App\Entity;
use App\Repository\ClientRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ClientRepository::class)
* @ORM\HasLifecycleCallbacks()
*/
class Client
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $firstName;
/**
* @ORM\Column(type="string", length=255)
*/
private $lastName;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $condicionFiscal;
/**
* @ORM\Column(type="string", length=30)
*/
private $dni;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $telephone;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $cellphone;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $address;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $addressNumber;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $addressFloor;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $addressApartment;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $location;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $state;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $origin;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $notifyByEmail;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $notifyByWhatsapp;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $notifyVehicleEntry;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $notifyCriteria = [];
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\OneToMany(targetEntity=CarBuy::class, mappedBy="client")
*/
private $carBuyClientId;
/**
* @ORM\OneToMany(targetEntity=CarSale::class, mappedBy="client")
*/
private $carSaleClientId;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="client")
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $email;
/**
* @ORM\Column(type="date", nullable=true)
*/
private ?\DateTimeInterface $licenceVenc = null;
public function __construct()
{
$this->arBuyClientId = new ArrayCollection();
$this->carSaleClientId = new ArrayCollection();
$this->carBuyClientId = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getFirstName(): ?string
{
return $this->firstName;
}
public function setFirstName(string $firstName): self
{
$this->firstName = $firstName;
return $this;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(string $lastName): self
{
$this->lastName = $lastName;
return $this;
}
public function getDni(): ?int
{
return $this->dni;
}
public function setDni(?int $dni): self
{
$this->dni = $dni;
return $this;
}
public function getCondicionFiscal(): ?string
{
return $this->condicionFiscal;
}
public function setCondicionFiscal(string $condicionFiscal): self
{
$this->condicionFiscal = $condicionFiscal;
return $this;
}
public function getTelephone(): ?string
{
return $this->telephone;
}
public function setTelephone(?string $telephone): self
{
$this->telephone = $telephone;
return $this;
}
public function getCellphone(): ?string
{
return $this->cellphone;
}
public function setCellphone(?string $cellphone): self
{
$this->cellphone = $cellphone;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(?string $address): self
{
$this->address = $address;
return $this;
}
public function getOrigin(): ?string
{
return $this->origin;
}
public function setOrigin(?string $origin): self
{
$this->origin = $origin;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getLicenceVenc(): ?\DateTimeInterface
{
return $this->licenceVenc;
}
public function setLicenceVenc(?\DateTimeInterface $licenceVenc): self
{
$this->licenceVenc = $licenceVenc;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
/**
* @ORM\PrePersist
*/
public function setCreatedAt(): self
{
$this->createdAt = new \DateTime();
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
/**
* @ORM\PreUpdate
*/
public function setUpdatedAt(): self
{
$this->updatedAt = new \DateTime();
return $this;
}
/**
* @return Collection|CarBuy[]
*/
public function getCarBuyClientId(): Collection
{
return $this->carBuyClientId;
}
public function addCarBuyClientId(CarBuy $carBuyClientId): self
{
if (!$this->carBuyClientId->contains($carBuyClientId)) {
$this->carBuyClientId[] = $carBuyClientId;
$carBuyClientId->setClientBuy($this);
}
return $this;
}
public function removeCarBuyClientId(CarBuy $carBuyClientId): self
{
if ($this->carBuyClientId->removeElement($carBuyClientId)) {
// set the owning side to null (unless already changed)
if ($carBuyClientId->getClientBuy() === $this) {
$carBuyClientId->setClientBuy(null);
}
}
return $this;
}
/**
* @return Collection|CarSale[]
*/
public function getCarSaleClientId(): Collection
{
return $this->carSaleClientId;
}
public function addCarSaleClientId(CarSale $carSaleClientId): self
{
if (!$this->carSaleClientId->contains($carSaleClientId)) {
$this->carSaleClientId[] = $carSaleClientId;
$carSaleClientId->setClientSale($this);
}
return $this;
}
public function removeCarSaleClientId(CarSale $carSaleClientId): self
{
if ($this->carSaleClientId->removeElement($carSaleClientId)) {
// set the owning side to null (unless already changed)
if ($carSaleClientId->getClientSale() === $this) {
$carSaleClientId->setClientSale(null);
}
}
return $this;
}
public function __toString()
{
return $this->firstName.' '.$this->lastName;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getNotifyByEmail(): ?bool
{
return $this->notifyByEmail;
}
public function setNotifyByEmail(?bool $notifyByEmail): self
{
$this->notifyByEmail = $notifyByEmail;
return $this;
}
public function getNotifyByWhatsapp(): ?bool
{
return $this->notifyByWhatsapp;
}
public function setNotifyByWhatsapp(?bool $notifyByWhatsapp): self
{
$this->notifyByWhatsapp = $notifyByWhatsapp;
return $this;
}
public function getAddressNumber(): ?string
{
return $this->addressNumber;
}
public function setAddressNumber(?string $addressNumber): self
{
$this->addressNumber = $addressNumber;
return $this;
}
public function getAddressFloor(): ?string
{
return $this->addressFloor;
}
public function setAddressFloor(?string $addressFloor): self
{
$this->addressFloor = $addressFloor;
return $this;
}
public function getAddressApartment(): ?string
{
return $this->addressApartment;
}
public function setAddressApartment(?string $addressApartment): self
{
$this->addressApartment = $addressApartment;
return $this;
}
public function getLocation(): ?string
{
return $this->location;
}
public function setLocation(?string $location): self
{
$this->location = $location;
return $this;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(?string $state): self
{
$this->state = $state;
return $this;
}
public function getNotifyVehicleEntry(): ?bool
{
return $this->notifyVehicleEntry;
}
public function setNotifyVehicleEntry(?bool $notifyVehicleEntry): self
{
$this->notifyVehicleEntry = $notifyVehicleEntry;
return $this;
}
public function getNotifyCriteria(): ?array
{
return $this->notifyCriteria;
}
public function setNotifyCriteria(?array $notifyCriteria): self
{
$this->notifyCriteria = $notifyCriteria;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
$this->email = $email;
return $this;
}
}