src/Entity/Utilisateur/Intervention.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Utilisateur;
  3. use App\Entity\GestionComerciale\ArticleCommande;
  4. use App\Entity\GestionComerciale\Commande;
  5. use DateTime;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10.  * Intervention
  11.  *
  12.  * @ORM\Table("utilisateur__intervention")
  13.  * @ORM\Entity(repositoryClass="App\Repository\Utilisateur\InterventionRepository")
  14.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  15.  */
  16. class Intervention
  17. {
  18.     /**
  19.      * @ORM\Column(name="id", type="integer")
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="interventions")
  26.      * @ORM\JoinColumn(nullable=true)
  27.      */
  28.     private $utilisateur;
  29.     
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\Commande", inversedBy="interventions")
  32.      * @ORM\JoinColumn(nullable=true)
  33.      */
  34.     private $ordreRep;
  35.     
  36.     /**
  37.      * @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\ArticleCommande", inversedBy="interventions")
  38.      * @ORM\JoinColumn(nullable=true)
  39.      */
  40.     private $articleCommande;
  41.     
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="interventionsMecanicien")
  44.      * @Assert\NotNull(message="Merci de définir un mécanicien")
  45.      * @ORM\JoinColumn(nullable=true)
  46.      */
  47.     private $mecanicien;
  48.     /**
  49.      * @ORM\Column(name="date", type="datetime", nullable=true)
  50.      */
  51.     private $date;
  52.     
  53.     /**
  54.      * @ORM\Column(name="date_intervention", type="datetime", nullable=true)
  55.      * @Assert\NotNull(message="Merci de définir la date de réalisation")
  56.      */
  57.     private $dateIntervention;
  58.     /**
  59.      * @ORM\Column(name="date_supression", type="datetime", nullable=true)
  60.      */
  61.     private $dateSuppression;
  62.     /**
  63.      * @ORM\Column(name="date_maj", type="datetime", nullable=true)
  64.      * @Gedmo\Timestampable(on="update")
  65.      */
  66.     private $dateMaj;
  67.     /**
  68.      * @ORM\Column(name="duree", type="float", nullable=true)
  69.      * @Assert\NotBlank(message="La durée d'intervention est obligatoire")
  70.      */
  71.     private $duree;
  72.     
  73.     /**
  74.      * @ORM\Column(name="commentaire", type="text", nullable=true)
  75.     */
  76.     private $commentaire;
  77.     public function __construct()
  78.     {
  79.         $this->date = new Datetime();
  80.         $this->dateIntervention = new Datetime();
  81.     }
  82.     
  83.     public function getId(): int
  84.     {
  85.         return $this->id;
  86.     }
  87.     public function setDate(?DateTime $date): Intervention
  88.     {
  89.         $this->date $date;
  90.         return $this;
  91.     }
  92.     public function getDate(): ?DateTime
  93.     {
  94.         return $this->date;
  95.     }
  96.     public function setDateSuppression(?DateTime $dateSuppression): Intervention
  97.     {
  98.         $this->dateSuppression $dateSuppression;
  99.         return $this;
  100.     }
  101.     public function getDateSuppression(): ?DateTime
  102.     {
  103.         return $this->dateSuppression;
  104.     }
  105.     public function setDateMaj(?DateTime $dateMaj): Intervention
  106.     {
  107.         $this->dateMaj $dateMaj;
  108.         return $this;
  109.     }
  110.     public function getDateMaj(): ?DateTime
  111.     {
  112.         return $this->dateMaj;
  113.     }
  114.     public function setDuree(?float $duree): Intervention
  115.     {
  116.         $this->duree $duree;
  117.         return $this;
  118.     }
  119.     public function getDuree(): ?float
  120.     {
  121.         return $this->duree;
  122.     }
  123.     public function setUtilisateur(?Utilisateur $utilisateur): Intervention
  124.     {
  125.         $this->utilisateur $utilisateur;
  126.         return $this;
  127.     }
  128.     public function getUtilisateur(): ?Utilisateur
  129.     {
  130.         return $this->utilisateur;
  131.     }
  132.     public function setMecanicien(?Utilisateur $mecanicien): Intervention
  133.     {
  134.         $this->mecanicien $mecanicien;
  135.         return $this;
  136.     }
  137.     public function getMecanicien(): ?Utilisateur
  138.     {
  139.         return $this->mecanicien;
  140.     }
  141.     public function setDateIntervention(?DateTime $dateIntervention): Intervention
  142.     {
  143.         $this->dateIntervention $dateIntervention;
  144.         return $this;
  145.     }
  146.     public function getDateIntervention(): ?DateTime
  147.     {
  148.         return $this->dateIntervention;
  149.     }
  150.     public function setOrdreRep(?Commande $ordreRep): Intervention
  151.     {
  152.         $this->ordreRep $ordreRep;
  153.         return $this;
  154.     }
  155.     public function getOrdreRep(): ?Commande
  156.     {
  157.         return $this->ordreRep;
  158.     }
  159.     public function setCommentaire(?string $commentaire): Intervention
  160.     {
  161.         $this->commentaire $commentaire;
  162.         return $this;
  163.     }
  164.     public function getCommentaire(): ?string
  165.     {
  166.         return $this->commentaire;
  167.     }
  168.     public function setArticleCommande(?ArticleCommande $articleCommande): Intervention
  169.     {
  170.         $this->articleCommande $articleCommande;
  171.         return $this;
  172.     }
  173.     public function getArticleCommande(): ?ArticleCommande
  174.     {
  175.         return $this->articleCommande;
  176.     }
  177. }