<?php
namespace App\Entity\Articles;
use App\Entity\GestionComerciale\ArticleCommande;
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;
/**
* ArticleAssocie
*
* @ORM\Table("article__article_associe")
* @ORM\Entity(repositoryClass="App\Repository\Articles\ArticleAssocieRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
*/
class ArticleAssocie
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="articles")
* @ORM\JoinColumn(nullable=true)
*/
private $utilisateur;
/**
* @ORM\Column(name="date", type="datetime")
*/
private $date;
/**
* @ORM\Column(name="date_supression", type="datetime", nullable=true)
*/
private $dateSuppression;
/**
* @ORM\Column(name="date_maj", type="datetime", nullable=true)
* @Gedmo\Timestampable(on="update")
*/
private $dateMaj;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Articles\Article", inversedBy="articlesAssociesParent")
*/
private $parent;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Articles\Article", inversedBy="articlesAssociesEnfant")
*/
private $enfant;
/**
* @ORM\Column(name="quantite", type="float", nullable=true)
*/
private $quantite;
/**
* @ORM\OneToMany(targetEntity="App\Entity\GestionComerciale\ArticleCommande", mappedBy="articleAssocie")
* @ORM\JoinColumn(nullable=true)
*/
private $articlesCommande;
/**
* @ORM\Column(name="ordre", type="integer", nullable=true)
*/
private $ordre;
public function __construct()
{
$this->date = new Datetime();
$this->articlesCommande = new ArrayCollection();
}
public function getId(): int
{
return $this->id;
}
public function setDate(DateTime $date): ArticleAssocie
{
$this->date = $date;
return $this;
}
public function getDate(): DateTime
{
return $this->date;
}
public function setDateSuppression(?DateTime $dateSuppression): ArticleAssocie
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?DateTime
{
return $this->dateSuppression;
}
public function setDateMaj(?DateTime $dateMaj): ArticleAssocie
{
$this->dateMaj = $dateMaj;
return $this;
}
public function getDateMaj(): ?DateTime
{
return $this->dateMaj;
}
public function setQuantite(?float $quantite): ArticleAssocie
{
$this->quantite = $quantite;
return $this;
}
public function getQuantite(): ?float
{
return $this->quantite;
}
public function setOrdre(?int $ordre): ArticleAssocie
{
$this->ordre = $ordre;
return $this;
}
public function getOrdre(): ?int
{
return $this->ordre;
}
public function setUtilisateur(?Utilisateur $utilisateur): ArticleAssocie
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getUtilisateur(): ?Utilisateur
{
return $this->utilisateur;
}
public function setParent(?Article $parent): ArticleAssocie
{
$this->parent = $parent;
return $this;
}
public function getParent(): ?Article
{
return $this->parent;
}
public function setEnfant(?Article $enfant): ArticleAssocie
{
$this->enfant = $enfant;
return $this;
}
public function getEnfant(): ?Article
{
return $this->enfant;
}
public function addArticlesCommande(ArticleCommande $articlesCommande): ArticleAssocie
{
$this->articlesCommande[] = $articlesCommande;
return $this;
}
public function removeArticlesCommande(ArticleCommande $articlesCommande)
{
$this->articlesCommande->removeElement($articlesCommande);
}
public function getArticlesCommande(): Collection
{
return $this->articlesCommande;
}
}