<?php
namespace App\Entity\Litiges;
use App\Entity\Clients\Client;
use App\Entity\Fournisseurs\Fournisseur;
use App\Entity\GestionComerciale\ArticleCommande;
use App\Entity\GestionComerciale\Commande;
use App\Entity\GestionComerciale\CommandeFournisseur;
use App\Entity\Utilisateur\Utilisateur;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping\Index;
/**
* Litige
*
* @ORM\Table("litige__litige")
* @ORM\Entity(repositoryClass="App\Repository\Litiges\LitigeRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
*/
class Litige
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur")
* @ORM\JoinColumn(nullable=true)
*/
private $utilisateur;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Clients\Client", inversedBy="litiges")
* @ORM\JoinColumn(nullable=true)
* @Assert\Valid
*/
private $client;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Fournisseurs\Fournisseur", inversedBy="litiges")
* @ORM\JoinColumn(nullable=true)
* @Assert\Valid
*/
private $fournisseur;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\CommandeFournisseur", inversedBy="litiges")
* @ORM\JoinColumn(nullable=true)
* @Assert\Valid
*/
private $commandeFournisseur;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\Commande", inversedBy="litiges")
* @ORM\JoinColumn(nullable=true)
* @Assert\Valid
*/
private $commande;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\Commande")
* @ORM\JoinColumn(nullable=true)
* @Assert\Valid
*/
private $commandeParent;
/**
* @ORM\Column(name="date", type="datetime", nullable=true)
*/
private $date;
/**
* @ORM\Column(name="dateCloture", type="datetime", nullable=true)
*/
private $dateCloture;
/**
* @ORM\Column(name="reference", type="string", length=255, nullable=true)
*/
private $reference;
/**
* @ORM\Column(name="dateMaj", type="datetime", nullable=true)
* @Gedmo\Timestampable(on="update")
*/
private $dateMaj;
/**
* @ORM\Column(name="montant", type="float", nullable=true)
* @Assert\NotBlank(message="Montant obligatoire")
*/
private $montant;
/**
* @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
*/
private $dateSuppression;
/**
* @ORM\Column(name="statut", type="boolean", nullable=true)
*/
private $statut;
/**
* @ORM\Column(name="commentaire", type="text", nullable=true)
*/
private $commentaire;
/**
* @ORM\OneToMany(targetEntity="App\Entity\GestionComerciale\ArticleCommande", mappedBy="litige")
* @ORM\OrderBy({"position" = "ASC", "id" = "ASC"})
*/
private $articleCommande;
public function __construct()
{
$this->date = new Datetime();
$this->statut = false;
$this->articleCommande = new ArrayCollection();
}
public function getId(): int
{
return $this->id;
}
public function setDate(?DateTime $date): Litige
{
$this->date = $date;
return $this;
}
public function getDate(): ?DateTime
{
return $this->date;
}
public function setDateCloture(?DateTime $dateCloture): Litige
{
$this->dateCloture = $dateCloture;
return $this;
}
public function getDateCloture(): ?DateTime
{
return $this->dateCloture;
}
public function setReference(?string $reference): Litige
{
$this->reference = $reference;
return $this;
}
public function getReference(): ?string
{
return $this->reference;
}
public function setDateMaj(?DateTime $dateMaj): Litige
{
$this->dateMaj = $dateMaj;
return $this;
}
public function getDateMaj(): ?DateTime
{
return $this->dateMaj;
}
public function setMontant(?float $montant): Litige
{
$this->montant = $montant;
return $this;
}
public function getMontant(): ?float
{
return $this->montant;
}
public function setDateSuppression(?DateTime $dateSuppression): Litige
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?DateTime
{
return $this->dateSuppression;
}
public function setCommandeFournisseur(?CommandeFournisseur $commandeFournisseur): Litige
{
$this->commandeFournisseur = $commandeFournisseur;
return $this;
}
public function getCommandeFournisseur(): ?CommandeFournisseur
{
return $this->commandeFournisseur;
}
public function setCommande(?Commande $commande): Litige
{
$this->commande = $commande;
return $this;
}
public function getCommande(): ?Commande
{
return $this->commande;
}
public function setStatut(?bool $statut): Litige
{
$this->statut = $statut;
return $this;
}
public function getStatut(): ?bool
{
return $this->statut;
}
public function setCommentaire(?string $commentaire): Litige
{
$this->commentaire = $commentaire;
return $this;
}
public function getCommentaire(): ?string
{
return $this->commentaire;
}
public function setClient(?Client $client): Litige
{
$this->client = $client;
return $this;
}
public function getClient(): ?Client
{
return $this->client;
}
public function setFournisseur(?Fournisseur $fournisseur): Litige
{
$this->fournisseur = $fournisseur;
return $this;
}
public function getFournisseur(): ?Fournisseur
{
return $this->fournisseur;
}
public function setUtilisateur(?Utilisateur $utilisateur): Litige
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getUtilisateur(): ?Utilisateur
{
return $this->utilisateur;
}
public function setCommandeParent(?Commande $commandeParent): Litige
{
$this->commandeParent = $commandeParent;
return $this;
}
public function getCommandeParent(): ?Commande
{
return $this->commandeParent;
}
public function addArticleCommande(ArticleCommande $articleCommande): Litige
{
$this->articleCommande[] = $articleCommande;
return $this;
}
public function removeArticleCommande(ArticleCommande $articleCommande)
{
$this->articleCommande->removeElement($articleCommande);
}
public function getArticleCommande(): Collection
{
return $this->articleCommande;
}
}