<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\ConditionnementRepository")
*/
class Conditionnement
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $createdAt;
/**
* @ORM\OneToMany(targetEntity="App\Entity\LetterOfIntentToPurchase", mappedBy="conditionnement")
*/
private $letterOfIntentToPurchases;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Quotation", mappedBy="conditionnement")
*/
private $quotations;
/**
* @ORM\OneToMany(targetEntity="App\Entity\DemandeDeCotation", mappedBy="conditionnement")
*/
private $demandeDeCotations;
public function __construct(){
$this->createdAt = new \DateTime('now');
$this->letterOfIntentToPurchases = new ArrayCollection();
$this->quotations = new ArrayCollection();
$this->demandeDeCotations = new ArrayCollection();
}
public function __toString(){
return $this->name;
}
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 getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return Collection|LetterOfIntentToPurchase[]
*/
public function getLetterOfIntentToPurchases(): Collection
{
return $this->letterOfIntentToPurchases;
}
public function addLetterOfIntentToPurchase(LetterOfIntentToPurchase $letterOfIntentToPurchase): self
{
if (!$this->letterOfIntentToPurchases->contains($letterOfIntentToPurchase)) {
$this->letterOfIntentToPurchases[] = $letterOfIntentToPurchase;
$letterOfIntentToPurchase->setConditionnement($this);
}
return $this;
}
public function removeLetterOfIntentToPurchase(LetterOfIntentToPurchase $letterOfIntentToPurchase): self
{
if ($this->letterOfIntentToPurchases->contains($letterOfIntentToPurchase)) {
$this->letterOfIntentToPurchases->removeElement($letterOfIntentToPurchase);
// set the owning side to null (unless already changed)
if ($letterOfIntentToPurchase->getConditionnement() === $this) {
$letterOfIntentToPurchase->setConditionnement(null);
}
}
return $this;
}
/**
* @return Collection |DemandeDeCotation[]
*/
public function getDemandeDeCotations(): Collection
{
return $this->demandeDeCotations;
}
public function addDemandeDeCotation(DemandeDeCotation $demandeDeCotation): self
{
if (!$this->demandeDeCotations->contains($demandeDeCotation)) {
$this->demandeDeCotations[] = $demandeDeCotation;
$demandeDeCotation->setConditionnement($this);
}
return $this;
}
public function removeDemandeDeCotation(DemandeDeCotation $demandeDeCotation): self
{
if ($this->demandeDeCotations->contains($demandeDeCotation)) {
$this->demandeDeCotations->removeElement($demandeDeCotation);
// set the owning side to null (unless already changed)
if ($demandeDeCotation->getConditionnement() === $this) {
$demandeDeCotation->setConditionnement(null);
}
}
return $this;
}
/**
* @return Collection|Quotation[]
*/
public function getQuotations(): Collection
{
return $this->quotations;
}
public function addQuotation(Quotation $quotation): self
{
if (!$this->quotations->contains($quotation)) {
$this->quotations[] = $quotation;
$quotation->setConditionnement($this);
}
return $this;
}
public function removeQuotation(Quotation $quotation): self
{
if ($this->quotations->contains($quotation)) {
$this->quotations->removeElement($quotation);
// set the owning side to null (unless already changed)
if ($quotation->getConditionnement() === $this) {
$quotation->setConditionnement(null);
}
}
return $this;
}
}