src/Entity/FO/TacheCron.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity\FO;
  3. use App\Entity\Utilisateur\Utilisateur;
  4. use DateTime;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Gedmo\Mapping\Annotation as Gedmo;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. use Symfony\Component\Validator\ExecutionContextInterface;
  11. use App\Annotations\SecuredEntity;
  12. /**
  13.  * TacheCron
  14.  *
  15.  * @ORM\Table("cron__tache_cron")
  16.  * @ORM\Entity(repositoryClass="App\Repository\FO\TacheCronRepository")
  17.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  18.  * @SecuredEntity (name="Tâche Cron", group="REGLAGES")
  19.  */
  20. class TacheCron
  21. {
  22.     /**
  23.      * @ORM\Column(name="id", type="integer")
  24.      * @ORM\Id
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     private $id;
  28.     
  29.     /**
  30.      * @ORM\OneToMany(targetEntity="App\Entity\FO\Cron", mappedBy="tacheCron")
  31.      */
  32.     private $crons;
  33.     
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="tacheCron")
  36.      * @ORM\JoinColumn(nullable=true)
  37.      */
  38.     private $utilisateur;
  39.     /**
  40.      * @ORM\Column(name="libelle", type="string", length=255, nullable=true)
  41.      * @Assert\NotBlank(message="Libellé obligatoire")     
  42.      */
  43.     private $libelle;
  44.     /**
  45.      * @ORM\Column(name="frequence", type="integer", nullable=true)
  46.      */
  47.     private $frequence;
  48.     
  49.     /**
  50.      * @ORM\Column(name="statut", type="boolean", nullable=true)
  51.      */
  52.     private $statut;
  53.     /**
  54.      * @ORM\Column(name="date", type="datetime", nullable=true)
  55.      */
  56.     private $date;
  57.     /**
  58.      * @ORM\Column(name="date_suppression", type="datetime", nullable=true)
  59.      */
  60.     private $dateSuppression;
  61.     /**
  62.      * @ORM\Column(name="date_maj", type="datetime", nullable=true)
  63.      * @Gedmo\Timestampable(on="update")     
  64.      */
  65.     private $dateMaj;
  66.     /**
  67.      * @ORM\Column(name="commande", type="string", length=255, nullable=true)
  68.      */
  69.     private $commande;
  70.     /**
  71.      * @ORM\Column(name="description", type="text", nullable=true)
  72.      */
  73.     private $description;
  74.     public function __construct()
  75.     {
  76.         $this->date  = new Datetime();
  77.         $this->crons = new ArrayCollection();
  78.     }
  79.     public function getId(): int
  80.     {
  81.         return $this->id;
  82.     }
  83.     public function setLibelle(?string $libelle): TacheCron
  84.     {
  85.         $this->libelle $libelle;
  86.         return $this;
  87.     }
  88.     public function getLibelle(): ?string
  89.     {
  90.         return $this->libelle;
  91.     }
  92.     public function setDate(?DateTime $date): TacheCron
  93.     {
  94.         $this->date $date;
  95.         return $this;
  96.     }
  97.     public function getDate(): ?DateTime
  98.     {
  99.         return $this->date;
  100.     }
  101.     public function setDateSuppression(?DateTime $dateSuppression): TacheCron
  102.     {
  103.         $this->dateSuppression $dateSuppression;
  104.         return $this;
  105.     }
  106.     public function getDateSuppression(): ?DateTime
  107.     {
  108.         return $this->dateSuppression;
  109.     }
  110.     public function setDateMaj(?DateTime $dateMaj): TacheCron
  111.     {
  112.         $this->dateMaj $dateMaj;
  113.         return $this;
  114.     }
  115.     public function getDateMaj(): ?DateTime
  116.     {
  117.         return $this->dateMaj;
  118.     }
  119.     public function setCommande(?string $commande): TacheCron
  120.     {
  121.         $this->commande $commande;
  122.         return $this;
  123.     }
  124.     public function getCommande(): ?string
  125.     {
  126.         return $this->commande;
  127.     }
  128.     public function setDescription(?string $description): TacheCron
  129.     {
  130.         $this->description $description;
  131.         return $this;
  132.     }
  133.     public function getDescription(): ?string
  134.     {
  135.         return $this->description;
  136.     }
  137.     public function setUtilisateur(?Utilisateur $utilisateur): TacheCron
  138.     {
  139.         $this->utilisateur $utilisateur;
  140.         return $this;
  141.     }
  142.     public function getUtilisateur(): ?Utilisateur
  143.     {
  144.         return $this->utilisateur;
  145.     }
  146.     public function addCron(Cron $crons): TacheCron
  147.     {
  148.         $this->crons[] = $crons;
  149.         return $this;
  150.     }
  151.     public function removeCron(Cron $crons)
  152.     {
  153.         $this->crons->removeElement($crons);
  154.     }
  155.     public function getCrons(): Collection
  156.     {
  157.         return $this->crons;
  158.     }
  159.     public function setFrequence(?int $frequence): TacheCron
  160.     {
  161.         $this->frequence $frequence;
  162.         return $this;
  163.     }
  164.     public function getFrequence(): ?int
  165.     {
  166.         return $this->frequence;
  167.     }
  168.     public function setStatut(?bool $statut): TacheCron
  169.     {
  170.         $this->statut $statut;
  171.         return $this;
  172.     }
  173.     public function getStatut(): ?bool
  174.     {
  175.         return $this->statut;
  176.     }
  177. }