<?php
namespace App\Entity\Imports;
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;
/**
* Entite
*
* @ORM\Table("import__entite")
* @ORM\Entity(repositoryClass="App\Repository\Imports\EntiteRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
* @SecuredEntity (name="Entité", group="IMPORTS")
*/
class Entite
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Imports\Champ", cascade={"persist"},mappedBy="entite")
* @ORM\OrderBy({"libelle" = "ASC"})
*/
private $champ;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="entiteImport")
* @ORM\JoinColumn(nullable=true)
*/
private $utilisateur;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="articleComptaImport")
* @ORM\JoinColumn(nullable=true)
*/
private $utilisateurComptaImport;
/**
* @ORM\Column(name="date", type="datetime", nullable=true)
*/
private $date;
/**
* @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
*/
private $dateSuppression;
/**
* @ORM\Column(name="dateMaj", type="datetime", nullable=true)
* @Gedmo\Timestampable(on="update")
*/
private $dateMaj;
/**
* @ORM\Column(name="libelle", type="string", length=255, nullable=true)
*/
private $libelle;
/**
* @ORM\Column(name="nom_table", type="string", length=255, nullable=true)
*/
private $nomTable;
/**
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
public function __construct()
{
$this->date = new Datetime();
$this->champ = new ArrayCollection();
}
public function getId(): int
{
return $this->id;
}
public function setDate(?DateTime $date): Entite
{
$this->date = $date;
return $this;
}
public function getDate(): ?DateTime
{
return $this->date;
}
public function setLibelle(?string $libelle): Entite
{
$this->libelle = $libelle;
return $this;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setDateSuppression(?DateTime $dateSuppression): Entite
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?DateTime
{
return $this->dateSuppression;
}
public function setDateMaj(?DateTime $dateMaj): Entite
{
$this->dateMaj = $dateMaj;
return $this;
}
public function getDateMaj(): ?DateTime
{
return $this->dateMaj;
}
public function setDescription(?string $description): Entite
{
$this->description = $description;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setUtilisateur(?Utilisateur $utilisateur): Entite
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getUtilisateur(): ?Utilisateur
{
return $this->utilisateur;
}
public function __toString() {
return $this->libelle;
}
public function addChamp(Champ $champ): Entite
{
$this->champ[] = $champ;
return $this;
}
public function removeChamp(Champ $champ)
{
$this->champ->removeElement($champ);
}
public function getChamp(): Collection
{
return $this->champ;
}
public function setNomTable(?string $nomTable): Entite
{
$this->nomTable = $nomTable;
return $this;
}
public function getNomTable(): ?string
{
return $this->nomTable;
}
}