<?php
namespace App\Entity;
use App\Repository\FormQuotationServicesRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=FormQuotationServicesRepository::class)
*/
class FormQuotationServices extends BaseForm
{
/**
* @ORM\Column(type="string")
* @Assert\Length(max="255")
* @Assert\NotBlank()
*/
private $type_person;
/**
* @ORM\Column(type="string")
* @Assert\Length(max="255")
* @Assert\NotBlank()
*/
private $document_type;
/**
* @ORM\Column(type="string")
* @Assert\Length(max="255")
* @Assert\NotBlank()
*/
private $document_number;
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\Length(max="255")
*/
private $company;
/**
* @ORM\Column(type="string")
* @Assert\Length(max="255")
* @Assert\NotBlank()
*/
private $name;
/**
* @ORM\Column(type="string")
* @Assert\Length(max="255")
* @Assert\NotBlank()
*/
private $lastname;
/**
* @ORM\Column(type="string")
* @Assert\Length(max="255")
* @Assert\NotBlank()
*/
private $phone;
/**
* @ORM\Column(type="string")
* @Assert\Length(max="255")
* @Assert\NotBlank()
*/
private $email;
/**
* @ORM\Column(type="string")
* @Assert\Length(max="255")
* @Assert\NotBlank()
*/
private $service;
/**
* @ORM\Column(type="string")
* @Assert\Length(max="255")
* @Assert\NotBlank()
*/
private $establishment;
/**
* @ORM\Column(type="string")
* @Assert\Length(max="255")
* @Assert\NotBlank()
*/
private $date;
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="quotation_services")
* @ORM\JoinColumn(name="adviser_id", referencedColumnName="id", onDelete="SET NULL")
*/
private $adviser;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $message;
/**
* FormQuotationServices constructor.
*/
public function __construct()
{
parent::__construct();
}
public function toRequest(): RequestService
{
return (new RequestService())
->setDate($this->getDate())
->setService($this->getService())
->setMessage($this->getMessage());
}
public function getTypePerson(): ?string
{
return $this->type_person;
}
public function setTypePerson(string $type_person): self
{
$this->type_person = $type_person;
return $this;
}
public function getDocumentType(): ?string
{
return $this->document_type;
}
public function setDocumentType(string $document_type): self
{
$this->document_type = $document_type;
return $this;
}
public function getDocumentNumber(): ?string
{
return $this->document_number;
}
public function setDocumentNumber(string $document_number): self
{
$this->document_number = $document_number;
return $this;
}
public function getCompany(): ?string
{
return $this->company;
}
public function setCompany(?string $company): self
{
$this->company = $company;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getLastname(): ?string
{
return $this->lastname;
}
public function setLastname(string $lastname): self
{
$this->lastname = $lastname;
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 getService(): ?string
{
return $this->service;
}
public function setService(string $service): self
{
$this->service = $service;
return $this;
}
public function getEstablishment(): ?string
{
return $this->establishment;
}
public function setEstablishment(string $establishment): self
{
$this->establishment = $establishment;
return $this;
}
public function getDate(): ?string
{
return $this->date;
}
public function setDate(string $date): self
{
$this->date = $date;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(?string $message): self
{
$this->message = $message;
return $this;
}
public function getAdviser(): ?User
{
return $this->adviser;
}
public function setAdviser(?User $adviser): self
{
$this->adviser = $adviser;
return $this;
}
}