<?php
namespace App\Entity\Inventaires;
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;
/**
* Type
*
* @ORM\Table("inventaire__type")
* @ORM\Entity(repositoryClass="App\Repository\Inventaires\TypeRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
*/
class Type
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="typesInventaire")
* @ORM\JoinColumn(nullable=true)
*/
private $utilisateur;
/**
* @ORM\Column(name="libelle", type="string", length=255, nullable=true)
*/
private $libelle;
/**
* @ORM\Column(name="date", type="datetime", nullable=true)
*/
private $date;
/**
* @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
*/
private $dateSuppression;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Inventaires\Inventaire", cascade={"persist"}, mappedBy="type")
*/
private $inventaires;
public function __construct()
{
$this->date = new Datetime();
$this->inventaires = new ArrayCollection();
}
/**
* toString
* @return string
*/
public function __toString()
{
return $this->getLibelle();
}
public function getId(): int
{
return $this->id;
}
public function setLibelle(?string $libelle): Type
{
$this->libelle = $libelle;
return $this;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setDate(?DateTime $date): Type
{
$this->date = $date;
return $this;
}
public function getDate(): ?DateTime
{
return $this->date;
}
public function setDateSuppression(?DateTime $dateSuppression): Type
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?DateTime
{
return $this->dateSuppression;
}
public function setUtilisateur(?Utilisateur $utilisateur): Type
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getUtilisateur(): ?Utilisateur
{
return $this->utilisateur;
}
public function addInventaire(Inventaire $inventaire): Type
{
$this->inventaires[] = $inventaire;
return $this;
}
public function removeInventaire(Inventaire $inventaire)
{
$this->inventaires->removeElement($inventaire);
}
public function getInventaires(): Collection
{
return $this->inventaires;
}
}