<?php
namespace App\Entity\Utilisateur;
use App\Entity\GestionComerciale\ArticleCommande;
use App\Entity\GestionComerciale\Commande;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Intervention
*
* @ORM\Table("utilisateur__intervention")
* @ORM\Entity(repositoryClass="App\Repository\Utilisateur\InterventionRepository")
* @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
*/
class Intervention
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="interventions")
* @ORM\JoinColumn(nullable=true)
*/
private $utilisateur;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\Commande", inversedBy="interventions")
* @ORM\JoinColumn(nullable=true)
*/
private $ordreRep;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\ArticleCommande", inversedBy="interventions")
* @ORM\JoinColumn(nullable=true)
*/
private $articleCommande;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="interventionsMecanicien")
* @Assert\NotNull(message="Merci de définir un mécanicien")
* @ORM\JoinColumn(nullable=true)
*/
private $mecanicien;
/**
* @ORM\Column(name="date", type="datetime", nullable=true)
*/
private $date;
/**
* @ORM\Column(name="date_intervention", type="datetime", nullable=true)
* @Assert\NotNull(message="Merci de définir la date de réalisation")
*/
private $dateIntervention;
/**
* @ORM\Column(name="date_supression", type="datetime", nullable=true)
*/
private $dateSuppression;
/**
* @ORM\Column(name="date_maj", type="datetime", nullable=true)
* @Gedmo\Timestampable(on="update")
*/
private $dateMaj;
/**
* @ORM\Column(name="duree", type="float", nullable=true)
* @Assert\NotBlank(message="La durée d'intervention est obligatoire")
*/
private $duree;
/**
* @ORM\Column(name="commentaire", type="text", nullable=true)
*/
private $commentaire;
public function __construct()
{
$this->date = new Datetime();
$this->dateIntervention = new Datetime();
}
public function getId(): int
{
return $this->id;
}
public function setDate(?DateTime $date): Intervention
{
$this->date = $date;
return $this;
}
public function getDate(): ?DateTime
{
return $this->date;
}
public function setDateSuppression(?DateTime $dateSuppression): Intervention
{
$this->dateSuppression = $dateSuppression;
return $this;
}
public function getDateSuppression(): ?DateTime
{
return $this->dateSuppression;
}
public function setDateMaj(?DateTime $dateMaj): Intervention
{
$this->dateMaj = $dateMaj;
return $this;
}
public function getDateMaj(): ?DateTime
{
return $this->dateMaj;
}
public function setDuree(?float $duree): Intervention
{
$this->duree = $duree;
return $this;
}
public function getDuree(): ?float
{
return $this->duree;
}
public function setUtilisateur(?Utilisateur $utilisateur): Intervention
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getUtilisateur(): ?Utilisateur
{
return $this->utilisateur;
}
public function setMecanicien(?Utilisateur $mecanicien): Intervention
{
$this->mecanicien = $mecanicien;
return $this;
}
public function getMecanicien(): ?Utilisateur
{
return $this->mecanicien;
}
public function setDateIntervention(?DateTime $dateIntervention): Intervention
{
$this->dateIntervention = $dateIntervention;
return $this;
}
public function getDateIntervention(): ?DateTime
{
return $this->dateIntervention;
}
public function setOrdreRep(?Commande $ordreRep): Intervention
{
$this->ordreRep = $ordreRep;
return $this;
}
public function getOrdreRep(): ?Commande
{
return $this->ordreRep;
}
public function setCommentaire(?string $commentaire): Intervention
{
$this->commentaire = $commentaire;
return $this;
}
public function getCommentaire(): ?string
{
return $this->commentaire;
}
public function setArticleCommande(?ArticleCommande $articleCommande): Intervention
{
$this->articleCommande = $articleCommande;
return $this;
}
public function getArticleCommande(): ?ArticleCommande
{
return $this->articleCommande;
}
}