<?php
namespace App\Entity;
use App\Repository\LigneDevisRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=LigneDevisRepository::class)
*/
class LigneDevis
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=EnteteDevis::class, inversedBy="ligneDevis")
*/
private $entetedevis;
/**
* @ORM\ManyToOne(targetEntity=Formation::class)
*/
private $formation;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $quantity;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $price;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $amount;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*/
private $created_at;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $remise;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $tva;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $amountht;
/**
* @ORM\ManyToOne(targetEntity=Session::class, inversedBy="ligneDevis")
*/
private $session;
/**
* @ORM\OneToMany(targetEntity=LigneConvention::class, mappedBy="devis")
*/
private $ligneConventions;
public function __construct()
{
$this->ligneConventions = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getEntetedevis(): ?EnteteDevis
{
return $this->entetedevis;
}
public function setEntetedevis(?EnteteDevis $entetedevis): self
{
$this->entetedevis = $entetedevis;
return $this;
}
public function getFormation(): ?Formation
{
return $this->formation;
}
public function setFormation(?Formation $formation): self
{
$this->formation = $formation;
return $this;
}
public function getQuantity(): ?int
{
return $this->quantity;
}
public function setQuantity(?int $quantity): self
{
$this->quantity = $quantity;
return $this;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(?float $price): self
{
$this->price = $price;
return $this;
}
public function getAmount(): ?float
{
return $this->amount;
}
public function setAmount(?float $amount): self
{
$this->amount = $amount;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->created_at;
}
public function setCreatedAt(?\DateTimeImmutable $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getRemise(): ?float
{
return $this->remise;
}
public function setRemise(?float $remise): self
{
$this->remise = $remise;
return $this;
}
public function getTva(): ?float
{
return $this->tva;
}
public function setTva(?float $tva): self
{
$this->tva = $tva;
return $this;
}
public function getAmountht(): ?float
{
return $this->amountht;
}
public function setAmountht(?float $amountht): self
{
$this->amountht = $amountht;
return $this;
}
public function getSession(): ?Session
{
return $this->session;
}
public function setSession(?Session $session): self
{
$this->session = $session;
return $this;
}
/**
* @return Collection<int, LigneConvention>
*/
public function getLigneConventions(): Collection
{
return $this->ligneConventions;
}
public function addLigneConvention(LigneConvention $ligneConvention): self
{
if (!$this->ligneConventions->contains($ligneConvention)) {
$this->ligneConventions[] = $ligneConvention;
$ligneConvention->setDevis($this);
}
return $this;
}
public function removeLigneConvention(LigneConvention $ligneConvention): self
{
if ($this->ligneConventions->removeElement($ligneConvention)) {
// set the owning side to null (unless already changed)
if ($ligneConvention->getDevis() === $this) {
$ligneConvention->setDevis(null);
}
}
return $this;
}
}