Deprecated: Constant E_STRICT is deprecated in /var/www/PixelForce/vendor/symfony/error-handler/ErrorHandler.php on line 58

Deprecated: Constant E_STRICT is deprecated in /var/www/PixelForce/vendor/symfony/error-handler/ErrorHandler.php on line 76
Symfony Profiler

src/Entity/ProduitSecuAccomp.php line 98

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProduitSecuAccompRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Entity\CategorieSecu;
  6. use Exception;
  7. use JsonSerializable;
  8. /**
  9.  * @ORM\Entity(repositoryClass=ProduitSecuAccompRepository::class)
  10.  */
  11. class ProduitSecuAccomp implements JsonSerializable
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $nom;
  23.     /**
  24.      * @ORM\Column(type="string", length=800, nullable=true)
  25.      */
  26.     private $description;
  27.     /**
  28.      * @ORM\Column(type="string", length=255, nullable=true)
  29.      */
  30.     private $photo;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity=Secteur::class, inversedBy="produits")
  33.      * @ORM\JoinColumn(nullable=false)
  34.      */
  35.     private $secteur;
  36.     /**
  37.      * @ORM\Column(type="integer")
  38.      */
  39.     private $statut;
  40.     /**
  41.      * @ORM\Column(type="float")
  42.      */
  43.     private $prix;
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getNom(): ?string
  49.     {
  50.         return $this->nom;
  51.     }
  52.     public function setNom(string $nom): self
  53.     {
  54.         $this->nom $nom;
  55.         return $this;
  56.     }
  57.     public function getDescription(): ?string
  58.     {
  59.         return $this->description;
  60.     }
  61.     public function setDescription(?string $description): self
  62.     {
  63.         $this->description $description;
  64.         return $this;
  65.     }
  66.     public function getPhoto(): ?string
  67.     {
  68.         return $this->photo;
  69.     }
  70.     public function setPhoto(?string $photo): self
  71.     {
  72.         $this->photo $photo;
  73.         return $this;
  74.     }
  75.     public function jsonSerialize()
  76.     {
  77.         $vars get_object_vars($this);
  78.         return $vars;
  79.     }
  80.     public function getSecteur(): ?Secteur
  81.     {
  82.         return $this->secteur;
  83.     }
  84.     public function setSecteur(?Secteur $secteur): self
  85.     {
  86.         $this->secteur $secteur;
  87.         return $this;
  88.     }
  89.     public function getStatut(): ?int
  90.     {
  91.         return $this->statut;
  92.     }
  93.     public function setStatut(int $statut): self
  94.     {
  95.         $this->statut $statut;
  96.         return $this;
  97.     }
  98.     public function getPrix()
  99.     {
  100.         return $this->prix;
  101.     }
  102.     public function setPrix($prix): self
  103.     {
  104.         $this->prix $prix;
  105.         return $this;
  106.     }
  107.     public function checkValid(){
  108.         if($this->getStatut() == 0)
  109.             throw new Exception("Accompagnement invalide");
  110.     }
  111.     
  112. }