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/ProduitSecu.php line 99

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProduitSecuRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Entity\CategorieSecu;
  6. use Exception;
  7. use JsonSerializable;
  8. /**
  9.  * @ORM\Entity(repositoryClass=ProduitSecuRepository::class)
  10.  */
  11. class ProduitSecu 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\ManyToOne(targetEntity="CategorieSecu", inversedBy="products")
  42.      * @ORM\JoinColumn(name="id_categorie", referencedColumnName="id")
  43.      */
  44.     private $categorie;
  45.     private $estFavori;
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getNom(): ?string
  51.     {
  52.         return $this->nom;
  53.     }
  54.     public function setNom(string $nom): self
  55.     {
  56.         $this->nom $nom;
  57.         return $this;
  58.     }
  59.     public function getDescription(): ?string
  60.     {
  61.         return $this->description;
  62.     }
  63.     public function setDescription(?string $description): self
  64.     {
  65.         $this->description $description;
  66.         return $this;
  67.     }
  68.     public function getPhoto(): ?string
  69.     {
  70.         return $this->photo;
  71.     }
  72.     public function setPhoto(?string $photo): self
  73.     {
  74.         $this->photo $photo;
  75.         return $this;
  76.     }
  77.     public function jsonSerialize()
  78.     {
  79.         $vars get_object_vars($this);
  80.         return $vars;
  81.     }
  82.     public function getSecteur(): ?Secteur
  83.     {
  84.         return $this->secteur;
  85.     }
  86.     public function setSecteur(?Secteur $secteur): self
  87.     {
  88.         $this->secteur $secteur;
  89.         return $this;
  90.     }
  91.     public function getStatut(): ?int
  92.     {
  93.         return $this->statut;
  94.     }
  95.     public function setStatut(int $statut): self
  96.     {
  97.         $this->statut $statut;
  98.         return $this;
  99.     }
  100.     /**
  101.      * Get the value of categorie
  102.      */ 
  103.     public function getCategorie(): ?CategorieSecu
  104.     {
  105.         return $this->categorie;
  106.     }
  107.     /**
  108.      * Set the value of categorie
  109.      *
  110.      * @return  self
  111.      */ 
  112.     public function setCategorie(CategorieSecu $categorie)
  113.     {
  114.         $this->categorie $categorie;
  115.         return $this;
  116.     }
  117.     public function checkValid(){
  118.         if($this->getStatut() == 0)
  119.             throw new Exception("Produit invalide");
  120.     }
  121.     
  122.     /**
  123.      * Get the value of estFavori
  124.      */ 
  125.     public function getEstFavori()
  126.     {
  127.         return $this->estFavori;
  128.     }
  129.     /**
  130.      * Set the value of estFavori
  131.      *
  132.      * @return  self
  133.      */ 
  134.     public function setEstFavori($estFavori)
  135.     {
  136.         $this->estFavori $estFavori;
  137.         return $this;
  138.     }
  139. }