<?php
namespace App\Entity;
use App\Repository\ComOfertaComercialRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ComOfertaComercialRepository::class)]
class ComOfertaComercial
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'comOfertaComerciales')] // plural aquĆ
#[ORM\JoinColumn(nullable: false)]
private ?TerEmpresa $terEmpresa = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $fechaEmision = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $consecutivo = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $vigenciaOferta = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $observacionesOferta = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $cargarOfertaPdf = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $ofertaExcel = null;
#[ORM\OneToMany(mappedBy: 'comOfertaComercial', targetEntity: ComResultadoNegociacion::class)]
private Collection $comResultadoNegociacion;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $createAt = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $updateAt = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $createUser = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $updateUser = null;
#[ORM\ManyToOne(inversedBy: 'comOfertaComercial')]
private ?TerPersona $terPersona = null;
#[ORM\ManyToOne(inversedBy: 'comOfertaComercials')]
private ?TerEmpresaCliente $comProspectoCliente = null;
#[ORM\ManyToMany(targetEntity: ComCreacionCliente::class, mappedBy: 'consecutivoAsociado')]
private Collection $comCreacionClientes;
#[ORM\OneToMany(mappedBy: 'comOfertaComercial', targetEntity: ComHojaVida::class)]
private Collection $comHojaVidas;
#[ORM\OneToMany(mappedBy: 'comOfertaComercial', targetEntity: ComServiciosContratados::class)]
private Collection $comServiciosContratados;
public function __construct()
{
$this->comResultadoNegociacion = new ArrayCollection();
$this->comCreacionClientes = new ArrayCollection();
$this->comHojaVidas = new ArrayCollection();
$this->comServiciosContratados = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTerEmpresa(): ?TerEmpresa
{
return $this->terEmpresa;
}
public function setTerEmpresa(TerEmpresa $terEmpresa): static
{
$this->terEmpresa = $terEmpresa;
return $this;
}
public function getFechaEmision(): ?\DateTimeInterface
{
return $this->fechaEmision;
}
public function setFechaEmision(\DateTimeInterface $fechaEmision): static
{
$this->fechaEmision = $fechaEmision;
return $this;
}
public function getConsecutivo(): ?string
{
return $this->consecutivo;
}
public function setConsecutivo(?string $consecutivo): static
{
$this->consecutivo = $consecutivo;
return $this;
}
public function getVigenciaOferta(): ?\DateTimeInterface
{
return $this->vigenciaOferta;
}
public function setVigenciaOferta(\DateTimeInterface $vigenciaOferta): static
{
$this->vigenciaOferta = $vigenciaOferta;
return $this;
}
public function getObservacionesOferta(): ?string
{
return $this->observacionesOferta;
}
public function setObservacionesOferta(?string $observacionesOferta): static
{
$this->observacionesOferta = $observacionesOferta;
return $this;
}
public function getCargarOfertaPdf(): ?string
{
return $this->cargarOfertaPdf;
}
public function setCargarOfertaPdf(string $cargarOfertaPdf): static
{
$this->cargarOfertaPdf = $cargarOfertaPdf;
return $this;
}
public function getOfertaExcel(): ?string
{
return $this->ofertaExcel;
}
public function setOfertaExcel(string $ofertaExcel): static
{
$this->ofertaExcel = $ofertaExcel;
return $this;
}
/**
* @return Collection<int, ComResultadoNegociacion>
*/
public function getComResultadoNegociacion(): Collection
{
return $this->comResultadoNegociacion;
}
public function addComResultadoNegociacion(ComResultadoNegociacion $comResultadoNegociacion): static
{
if (!$this->comResultadoNegociacion->contains($comResultadoNegociacion)) {
$this->comResultadoNegociacion->add($comResultadoNegociacion);
$comResultadoNegociacion->setComOfertaComercial($this);
}
return $this;
}
public function removeComResultadoNegociacion(ComResultadoNegociacion $comResultadoNegociacion): static
{
if ($this->comResultadoNegociacion->removeElement($comResultadoNegociacion)) {
// set the owning side to null (unless already changed)
if ($comResultadoNegociacion->getComOfertaComercial() === $this) {
$comResultadoNegociacion->setComOfertaComercial(null);
}
}
return $this;
}
public function getCreateAt(): ?\DateTimeInterface
{
return $this->createAt;
}
public function setCreateAt(?\DateTimeInterface $createAt): static
{
$this->createAt = $createAt;
return $this;
}
public function getUpdateAt(): ?\DateTimeInterface
{
return $this->updateAt;
}
public function setUpdateAt(?\DateTimeInterface $updateAt): static
{
$this->updateAt = $updateAt;
return $this;
}
public function getCreateUser(): ?string
{
return $this->createUser;
}
public function setCreateUser(?string $createUser): static
{
$this->createUser = $createUser;
return $this;
}
public function getUpdateUser(): ?string
{
return $this->updateUser;
}
public function setUpdateUser(?string $updateUser): static
{
$this->updateUser = $updateUser;
return $this;
}
public function getTerPersona(): ?TerPersona
{
return $this->terPersona;
}
public function setTerPersona(?TerPersona $terPersona): static
{
$this->terPersona = $terPersona;
return $this;
}
public function getComProspectoCliente(): ?TerEmpresaCliente
{
return $this->comProspectoCliente;
}
public function setComProspectoCliente(?TerEmpresaCliente $comProspectoCliente): static
{
$this->comProspectoCliente = $comProspectoCliente;
return $this;
}
/**
* @return Collection<int, ComCreacionCliente>
*/
public function getComCreacionClientes(): Collection
{
return $this->comCreacionClientes;
}
public function addComCreacionCliente(ComCreacionCliente $comCreacionCliente): static
{
if (!$this->comCreacionClientes->contains($comCreacionCliente)) {
$this->comCreacionClientes->add($comCreacionCliente);
$comCreacionCliente->addConsecutivoAsociado($this);
}
return $this;
}
public function removeComCreacionCliente(ComCreacionCliente $comCreacionCliente): static
{
if ($this->comCreacionClientes->removeElement($comCreacionCliente)) {
$comCreacionCliente->removeConsecutivoAsociado($this);
}
return $this;
}
/**
* @return Collection<int, ComHojaVida>
*/
public function getComHojaVidas(): Collection
{
return $this->comHojaVidas;
}
public function addComHojaVida(ComHojaVida $comHojaVida): static
{
if (!$this->comHojaVidas->contains($comHojaVida)) {
$this->comHojaVidas->add($comHojaVida);
$comHojaVida->setComOfertaComercial($this);
}
return $this;
}
public function removeComHojaVida(ComHojaVida $comHojaVida): static
{
if ($this->comHojaVidas->removeElement($comHojaVida)) {
// set the owning side to null (unless already changed)
if ($comHojaVida->getComOfertaComercial() === $this) {
$comHojaVida->setComOfertaComercial(null);
}
}
return $this;
}
/**
* @return Collection<int, ComServiciosContratados>
*/
public function getComServiciosContratados(): Collection
{
return $this->comServiciosContratados;
}
public function addComServiciosContratado(ComServiciosContratados $comServiciosContratado): static
{
if (!$this->comServiciosContratados->contains($comServiciosContratado)) {
$this->comServiciosContratados->add($comServiciosContratado);
$comServiciosContratado->setComOfertaComercial($this);
}
return $this;
}
public function removeComServiciosContratado(ComServiciosContratados $comServiciosContratado): static
{
if ($this->comServiciosContratados->removeElement($comServiciosContratado)) {
// set the owning side to null (unless already changed)
if ($comServiciosContratado->getComOfertaComercial() === $this) {
$comServiciosContratado->setComOfertaComercial(null);
}
}
return $this;
}
}