<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\IctusHistoriquePaiementRepository;
/**
* @ORM\Entity(repositoryClass=IctusHistoriquePaiementRepository::class)
*/
class IctusHistoriquePaiement
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=IctusCommande::class, inversedBy="ictusHistoriquePaiements")
* @ORM\JoinColumn(nullable=true)
*/
private $commande;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $montant;
/**
* @ORM\ManyToOne(targetEntity=IctusTypePaiement::class, inversedBy="ictusHistoriquePaiements")
*/
private $ictusTypePaiement;
/**
* @ORM\ManyToOne(targetEntity=CommandeSpecial::class, inversedBy="ictusHistoriquePaiements")
*/
private $commandeSpecial;
/**
* @ORM\OneToMany(targetEntity=IctusReclamation::class, mappedBy="historiquePaiement")
*/
private $ictusReclamations;
public function __construct(){
$this->createdAt = new \DateTime();
$this->ictusReclamations = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCommande(): ?IctusCommande
{
return $this->commande;
}
public function setCommande(?IctusCommande $commande): self
{
$this->commande = $commande;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getMontant(): ?float
{
return $this->montant;
}
public function setMontant(?float $montant): self
{
$this->montant = $montant;
return $this;
}
public function getIctusTypePaiement(): ?IctusTypePaiement
{
return $this->ictusTypePaiement;
}
public function setIctusTypePaiement(?IctusTypePaiement $ictusTypePaiement): self
{
$this->ictusTypePaiement = $ictusTypePaiement;
return $this;
}
public function getCommandeSpecial(): ?CommandeSpecial
{
return $this->commandeSpecial;
}
public function setCommandeSpecial(?CommandeSpecial $commandeSpecial): self
{
$this->commandeSpecial = $commandeSpecial;
return $this;
}
/**
* @return Collection<int, IctusReclamation>
*/
public function getIctusReclamations(): Collection
{
return $this->ictusReclamations;
}
public function addIctusReclamation(IctusReclamation $ictusReclamation): self
{
if (!$this->ictusReclamations->contains($ictusReclamation)) {
$this->ictusReclamations[] = $ictusReclamation;
$ictusReclamation->setHistoriquePaiement($this);
}
return $this;
}
public function removeIctusReclamation(IctusReclamation $ictusReclamation): self
{
if ($this->ictusReclamations->removeElement($ictusReclamation)) {
// set the owning side to null (unless already changed)
if ($ictusReclamation->getHistoriquePaiement() === $this) {
$ictusReclamation->setHistoriquePaiement(null);
}
}
return $this;
}
}