<?php
namespace App\Entity\FO;
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 Symfony\Component\Validator\ExecutionContextInterface;
use App\Annotations\SecuredEntity;
/**
* TacheCron
*
* @ORM\Table("cron__tache_cron")
* @ORM\Entity(repositoryClass="App\Repository\FO\TacheCronRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
* @SecuredEntity (name="Tâche Cron", group="REGLAGES")
*/
class TacheCron
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\OneToMany(targetEntity="App\Entity\FO\Cron", mappedBy="tacheCron")
*/
private $crons;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="tacheCron")
* @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="frequence", type="integer", nullable=true)
*/
private $frequence;
/**
* @ORM\Column(name="statut", type="boolean", nullable=true)
*/
private $statut;
/**
* @ORM\Column(name="date", type="datetime", nullable=true)
*/
private $date;
/**
* @ORM\Column(name="date_suppression", type="datetime", nullable=true)
*/
private $dateSuppression;
/**
* @ORM\Column(name="date_maj", type="datetime", nullable=true)
* @Gedmo\Timestampable(on="update")
*/
private $dateMaj;
/**
* @ORM\Column(name="commande", type="string", length=255, nullable=true)
*/
private $commande;
/**
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
public function __construct()
{
$this->date = new Datetime();
$this->crons = new ArrayCollection();
}
public function getId(): int
{
return $this->id;
}
public function setLibelle(?string $libelle): TacheCron
{
$this->libelle = $libelle;
return $this;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setDate(?DateTime $date): TacheCron
{
$this->date = $date;
return $this;
}
public function getDate(): ?DateTime
{
return $this->date;
}
public function setDateSuppression(?DateTime $dateSuppression): TacheCron
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?DateTime
{
return $this->dateSuppression;
}
public function setDateMaj(?DateTime $dateMaj): TacheCron
{
$this->dateMaj = $dateMaj;
return $this;
}
public function getDateMaj(): ?DateTime
{
return $this->dateMaj;
}
public function setCommande(?string $commande): TacheCron
{
$this->commande = $commande;
return $this;
}
public function getCommande(): ?string
{
return $this->commande;
}
public function setDescription(?string $description): TacheCron
{
$this->description = $description;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setUtilisateur(?Utilisateur $utilisateur): TacheCron
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getUtilisateur(): ?Utilisateur
{
return $this->utilisateur;
}
public function addCron(Cron $crons): TacheCron
{
$this->crons[] = $crons;
return $this;
}
public function removeCron(Cron $crons)
{
$this->crons->removeElement($crons);
}
public function getCrons(): Collection
{
return $this->crons;
}
public function setFrequence(?int $frequence): TacheCron
{
$this->frequence = $frequence;
return $this;
}
public function getFrequence(): ?int
{
return $this->frequence;
}
public function setStatut(?bool $statut): TacheCron
{
$this->statut = $statut;
return $this;
}
public function getStatut(): ?bool
{
return $this->statut;
}
}