<?php
namespace App\Entity\MarketPlace;
use App\Entity\GestionComerciale\Commande;
use App\Entity\GestionComerciale\StatutFabrication;
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 App\Annotations\SecuredEntity;
/**
* StatutCommande
*
* @ORM\Table("market_place__statut_commande")
* @ORM\Entity(repositoryClass="App\Repository\MarketPlace\StatutCommandeRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
* @SecuredEntity (name="Statut commande", group="MARKETPLACE")
*/
class StatutCommande
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(name="document_commercial_id", type="integer")
*/
private $documentCommercial;
/**
* @ORM\OneToMany(targetEntity="App\Entity\GestionComerciale\Commande", mappedBy="statutCommandeMarketPlace")
*/
private $commandes;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\StatutCommande")
*/
private $actionStatutCommande;
/**
* @ORM\Column(name="ordre", type="integer", nullable=true)
*/
private $ordre;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="statutCommande")
* @ORM\JoinColumn(nullable=true)
*/
private $utilisateur;
/**
* @ORM\Column(name="libelle", type="string", length=255, nullable=true)
* @Assert\NotBlank(message="Libellé obligatoire")
*/
private $libelle;
/**
* @ORM\Column(name="date", type="datetime", nullable=true)
*/
private $date;
/**
* @ORM\Column(name="dateMaj", type="datetime", nullable=true)
* @Gedmo\Timestampable(on="update")
*/
private $dateMaj;
/**
* @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
*/
private $dateSuppression;
/**
* @ORM\Column(name="origine", type="string", length=255, nullable=true)
*/
private $origine;
/**
* @ORM\Column(name="reference", type="string", length=255, nullable=true)
*/
private $reference;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\MarketPlace\MarketPlace")
* @ORM\JoinColumn(nullable=true)
*/
private $marketPlace;
public function __construct()
{
$this->date = new Datetime();
$this->ordre = 0;
$this->commandes = new ArrayCollection();
}
public function getId(): int
{
return $this->id;
}
public function setLibelle(?string $libelle): StatutCommande
{
$this->libelle = $libelle;
return $this;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setDate(?DateTime $date): StatutCommande
{
$this->date = $date;
return $this;
}
public function getDate(): ?DateTime
{
return $this->date;
}
public function setDateMaj(?DateTime $dateMaj): StatutCommande
{
$this->dateMaj = $dateMaj;
return $this;
}
public function getDateMaj(): ?DateTime
{
return $this->dateMaj;
}
public function setDateSuppression(?DateTime $dateSuppression): StatutCommande
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?DateTime
{
return $this->dateSuppression;
}
public function setUtilisateur(?Utilisateur $utilisateur): StatutCommande
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getUtilisateur(): ?Utilisateur
{
return $this->utilisateur;
}
public function addCommande(Commande $commandes): StatutCommande
{
$this->commandes[] = $commandes;
return $this;
}
public function removeCommande(Commande $commandes)
{
$this->commandes->removeElement($commandes);
}
public function getCommandes(): Collection
{
return $this->commandes;
}
public function __toString()
{
return $this->libelle;
}
public function setOrdre(?int $ordre): StatutCommande
{
$this->ordre = $ordre;
return $this;
}
public function getOrdre(): ?int
{
return $this->ordre;
}
public function setActionStatutCommande(?\App\Entity\GestionComerciale\StatutCommande $actionStatutCommande = null): StatutCommande
{
$this->actionStatutCommande = $actionStatutCommande;
return $this;
}
public function getActionStatutCommande(): ?\App\Entity\GestionComerciale\StatutCommande
{
return $this->actionStatutCommande;
}
public function setOrigine(?string $origine): StatutCommande
{
$this->origine = $origine;
return $this;
}
public function getOrigine(): ?string
{
return $this->origine;
}
public function setReference(?string $reference): StatutCommande
{
$this->reference = $reference;
return $this;
}
public function getReference(): ?string
{
return $this->reference;
}
public function setMarketPlace(?MarketPlace $marketPlace): StatutCommande
{
$this->marketPlace = $marketPlace;
return $this;
}
public function getMarketPlace(): ?MarketPlace
{
return $this->marketPlace;
}
public function getDocumentCommercial(): ?int
{
return $this->documentCommercial;
}
public function setDocumentCommercial(int $documentCommercial): self
{
$this->documentCommercial = $documentCommercial;
return $this;
}
}