<?php
namespace App\Entity;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass="App\Repository\LetterOfIntentToPurchaseRepository")
*/
class LetterOfIntentToPurchase
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $reference;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $mandataire;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\AdminDonneurOrdre", inversedBy="letterOfIntentToPurchases")
*/
private $recipient;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $date_saisie;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $representant;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $entreprise;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $numero_rc;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $pays;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $phone;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* *@Assert\Email(
* message = "The email '{{ value }}' is not a valid email."
* )
*/
private $email;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $product;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $quantity;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $origine;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $prix_cible;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $destination;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $delai_livraison;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $frequence;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $condition;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $adminName;
/**
* @ORM\Column(type="text", nullable=true, nullable=true)
*/
private $specification;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $date_expiration;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\SousJacent", inversedBy="letterOfIntentToPurchases")
*/
private $sousJacent;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Products", inversedBy="letterOfIntentToPurchases")
*/
private $filiere;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="letterOfIntentToPurchases")
*/
private $agent;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="letterOfIntentToPurchases")
*/
private $suivipar;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Status", inversedBy="letterOfIntentToPurchases")
*/
private $status;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\PaymentMethod", inversedBy="letterOfIntentToPurchases")
*/
private $payment_method;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Unite", inversedBy="letterOfIntentToPurchases")
*/
private $qt_unite;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Devise", inversedBy="letterOfIntentToPurchases")
*/
private $devise;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\PaymentMethod", inversedBy="letterOfIntentToPurchases")
*/
private $paiement_mode;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Niveau", inversedBy="letterOfIntentToPurchases")
*/
private $niveau;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Emballage", inversedBy="letterOfIntentToPurchases")
*/
private $emballage;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Conditionnement", inversedBy="letterOfIntentToPurchases")
*/
private $conditionnement;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Exigence", inversedBy="letterOfIntentToPurchases")
*/
private $exigence;
public function __construct()
{
$this->createdAt = new \DateTime('now');
if (!isset($this->reference)){
$this->reference = 'LIA'.random_int(1,99).date('s');
}else{
$this->reference = 'LIA'.random_int(1,99).date('s');
}
}
public function getId(): ?int
{
return $this->id;
}
/**
* @return mixed
*/
public function getReference()
{
return $this->reference;
}
/**
* @param string $reference
* @return LetterOfIntentToPurchase
*/
public function setReference($reference)
{
$this->reference = $reference;
return $this;
}
/**
* @return mixed
*/
public function getRecipient(): ?AdminDonneurOrdre
{
return $this->recipient;
}
public function setRecipient(?AdminDonneurOrdre $recipient):self
{
$this->recipient = $recipient;
return $this;
}
/**
* @return mixed
*/
public function getDateSaisie():?\DateTimeInterface
{
return $this->date_saisie;
}
/**
* @param mixed $date_saisie
* @return LetterOfIntentToPurchase
*/
public function setDateSaisie(?\DateTimeInterface $date_saisie):self
{
$this->date_saisie = $date_saisie;
return $this;
}
/**
* @return mixed
*/
public function getRepresentant():?string
{
return $this->representant;
}
/**
* @param mixed $representant
* @return LetterOfIntentToPurchase
*/
public function setRepresentant(?string $representant):self
{
$this->representant = $representant;
return $this;
}
/**
* @return mixed
*/
public function getEntreprise():?string
{
return $this->entreprise;
}
/**
* @param mixed $entreprise
* @return LetterOfIntentToPurchase
*/
public function setEntreprise(?string $entreprise):self
{
$this->entreprise = $entreprise;
return $this;
}
/**
* @return mixed
*/
public function getNumeroRc():?string
{
return $this->numero_rc;
}
/**
* @param mixed $numero_rc
* @return LetterOfIntentToPurchase
*/
public function setNumeroRc(?string $numero_rc):self
{
$this->numero_rc = $numero_rc;
return $this;
}
/**
* @return mixed
*/
public function getPays():?string
{
return $this->pays;
}
/**
* @param mixed $pays
* @return LetterOfIntentToPurchase
*/
public function setPays(?string $pays):self
{
$this->pays = $pays;
return $this;
}
/**
* @return mixed
*/
public function getPhone():?string
{
return $this->phone;
}
/**
* @param mixed $phone
* @return LetterOfIntentToPurchase
*/
public function setPhone(?string $phone):self
{
$this->phone = $phone;
return $this;
}
/**
* @return mixed
*/
public function getEmail():?string
{
return $this->email;
}
/**
* @param mixed $email
* @return LetterOfIntentToPurchase
*/
public function setEmail(?string $email)
{
$this->email = $email;
return $this;
}
/**
* @return mixed
*/
public function getProduct():?string
{
return $this->product;
}
/**
* @param mixed $product
* @return LetterOfIntentToPurchase
*/
public function setProduct(?string $product):self
{
$this->product = $product;
return $this;
}
/**
* @return mixed
*/
public function getQuantity():?string
{
return $this->quantity;
}
/**
* @param mixed $quantity
* @return LetterOfIntentToPurchase
*/
public function setQuantity($quantity)
{
$this->quantity = (float)str_ireplace(',','.',$quantity);
return $this;
}
/**
* @return mixed
*/
public function getOrigine()
{
return $this->origine;
}
/**
* @param mixed $origine
* @return LetterOfIntentToPurchase
*/
public function setOrigine($origine)
{
$this->origine = $origine;
return $this;
}
/**
* @return mixed
*/
public function getPrixCible()
{
return $this->prix_cible;
}
/**
* @param mixed $prix_cible
* @return LetterOfIntentToPurchase
*/
public function setPrixCible($prix_cible)
{
$this->prix_cible = (float)str_ireplace(',','.',$prix_cible);
return $this;
}
/**
* @return mixed
*/
public function getDestination()
{
return $this->destination;
}
/**
* @param mixed $destination
* @return LetterOfIntentToPurchase
*/
public function setDestination($destination)
{
$this->destination = $destination;
return $this;
}
/**
* @return mixed
*/
public function getDelaiLivraison()
{
return $this->delai_livraison;
}
/**
* @param mixed $delai_livraison
* @return LetterOfIntentToPurchase
*/
public function setDelaiLivraison($delai_livraison)
{
$this->delai_livraison = $delai_livraison;
return $this;
}
/**
* @return mixed
*/
public function getFrequence()
{
return $this->frequence;
}
/**
* @param mixed $frequence
* @return LetterOfIntentToPurchase
*/
public function setFrequence($frequence)
{
$this->frequence = $frequence;
return $this;
}
/**
* @return mixed
*/
public function getCondition()
{
return $this->condition;
}
/**
* @param mixed $condition
* @return LetterOfIntentToPurchase
*/
public function setCondition($condition)
{
$this->condition = $condition;
return $this;
}
/**
* @return mixed
*/
public function getAdminName()
{
return $this->adminName;
}
/**
* @param mixed $adminName
* @return LetterOfIntentToPurchase
*/
public function setAdminName($adminName)
{
$this->adminName = $adminName;
return $this;
}
/**
* @return mixed
*/
public function getSpecification()
{
return $this->specification;
}
/**
* @param mixed $specification
* @return LetterOfIntentToPurchase
*/
public function setSpecification($specification)
{
$this->specification = $specification;
return $this;
}
/**
* @return mixed
*/
public function getDateExpiration()
{
return $this->date_expiration;
}
/**
* @param mixed $date_expiration
* @return LetterOfIntentToPurchase
*/
public function setDateExpiration($date_expiration)
{
$this->date_expiration = $date_expiration;
return $this;
}
/**
* @return DateTime
*/
public function getCreatedAt(): DateTime
{
return $this->createdAt;
}
/**
* @param DateTime $createdAt
* @return LetterOfIntentToPurchase
*/
public function setCreatedAt(DateTime $createdAt): LetterOfIntentToPurchase
{
$this->createdAt = $createdAt;
return $this;
}
public function __toString(){
return $this->reference;
}
public function getSousJacent(): ?SousJacent
{
return $this->sousJacent;
}
public function setSousJacent(?SousJacent $sousJacent): self
{
$this->sousJacent = $sousJacent;
return $this;
}
public function getFiliere(): ?Products
{
return $this->filiere;
}
public function setFiliere(?Products $filiere): self
{
$this->filiere = $filiere;
return $this;
}
public function getAgent(): ?User
{
return $this->agent;
}
public function setAgent(?User $agent): self
{
$this->agent = $agent;
return $this;
}
public function getSuivipar(): ?User
{
return $this->suivipar;
}
public function setSuivipar(?User $suivipar): self
{
$this->suivipar = $suivipar;
return $this;
}
public function getStatus(): ?Status
{
return $this->status;
}
public function setStatus(?Status $status): self
{
$this->status = $status;
return $this;
}
public function getPaymentMethod(): ?PaymentMethod
{
return $this->payment_method;
}
public function setPaymentMethod(?PaymentMethod $payment_method): self
{
$this->payment_method = $payment_method;
return $this;
}
public function getQtUnite(): ?Unite
{
return $this->qt_unite;
}
public function setQtUnite(?Unite $qt_unite): self
{
$this->qt_unite = $qt_unite;
return $this;
}
public function getDevise(): ?Devise
{
return $this->devise;
}
public function setDevise(?Devise $devise): self
{
$this->devise = $devise;
return $this;
}
public function getPaiementMode(): ?PaymentMethod
{
return $this->paiement_mode;
}
public function setPaiementMode(?PaymentMethod $paiement_mode): self
{
$this->paiement_mode = $paiement_mode;
return $this;
}
public function getNiveau(): ?Niveau
{
return $this->niveau;
}
public function setNiveau(?Niveau $niveau): self
{
$this->niveau = $niveau;
return $this;
}
public function getEmballage(): ?Emballage
{
return $this->emballage;
}
public function setEmballage(?Emballage $emballage): self
{
$this->emballage = $emballage;
return $this;
}
public function getConditionnement(): ?Conditionnement
{
return $this->conditionnement;
}
public function setConditionnement(?Conditionnement $conditionnement): self
{
$this->conditionnement = $conditionnement;
return $this;
}
public function getExigence(): ?Exigence
{
return $this->exigence;
}
public function setExigence(?Exigence $exigence): self
{
$this->exigence = $exigence;
return $this;
}
public function getMandataire(): ?string
{
return $this->mandataire;
}
public function setMandataire(?string $mandataire): self
{
$this->mandataire = $mandataire;
return $this;
}
}