src/Entity/Produit/Produit/Caracteristiqueproduit.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Produit\Produit;
  3. use App\Validator\Validatortext\Taillemin;
  4. use App\Validator\Validatortext\Taillemax;
  5. use App\Repository\Produit\Produit\CaracteristiqueproduitRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use App\Entity\Produit\Produit\Produit;
  8. use App\Entity\Produit\Produit\Caracteristique;
  9. use App\Entity\Users\User\User;
  10. /**
  11.  * Caracteristiqueproduit
  12.  *
  13.  * @ORM\Table("caracteristiqueproduit")
  14.  * @ORM\Entity(repositoryClass=CaracteristiqueproduitRepository::class)
  15.  */
  16. class Caracteristiqueproduit
  17. {
  18.     /**
  19.      * @var integer
  20.      *
  21.      * @ORM\Column(name="id", type="integer")
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue(strategy="AUTO")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @var string
  28.      *
  29.      * @ORM\Column(name="valeur", type="text")
  30.      *@Taillemax(valeur=250, message="Au plus 250 caractès")
  31.      */
  32.     private $valeur;
  33.     /**
  34.      * @var integer
  35.      *
  36.      * @ORM\Column(name="isChecked", type="boolean")
  37.      */
  38.     private $isChecked;
  39.     /**
  40.      * @var \DateTime
  41.      *
  42.      * @ORM\Column(name="date", type="datetime")
  43.      */
  44.     private $date;
  45.     /**
  46.      * @ORM\ManyToOne(targetEntity=Produit::class, inversedBy="caracteristiqueproduits")
  47.      * @ORM\JoinColumn(nullable=true)
  48.     */
  49.     private $produit;
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity=Caracteristique::class, inversedBy="caracteristiqueproduits")
  52.      * @ORM\JoinColumn(nullable=true)
  53.     */
  54.     private $caracteristique;
  55.     /**
  56.       * @ORM\ManyToOne(targetEntity=User::class)
  57.       * @ORM\JoinColumn(nullable=false)
  58.       */
  59.     private $user;
  60.     
  61.     public function __construct()
  62.     {
  63.         $this->date = new \Datetime();
  64.         $this->isChecked false;
  65.     }
  66.     /**
  67.      * Get id
  68.      *
  69.      * @return integer 
  70.      */
  71.     public function getId()
  72.     {
  73.         return $this->id;
  74.     }
  75.     /**
  76.      * Set valeur
  77.      *
  78.      * @param string $valeur
  79.      * @return Caracteristiqueplan
  80.      */
  81.     public function setValeur($valeur)
  82.     {
  83.         $this->valeur $valeur;
  84.         return $this;
  85.     }
  86.     /**
  87.      * Get valeur
  88.      *
  89.      * @return string 
  90.      */
  91.     public function getValeur()
  92.     {
  93.         return $this->valeur;
  94.     }
  95.     /**
  96.      * Set date
  97.      *
  98.      * @param \DateTime $date
  99.      * @return Caracteristiqueplan
  100.      */
  101.     public function setDate($date)
  102.     {
  103.         $this->date $date;
  104.         return $this;
  105.     }
  106.     /**
  107.      * Get date
  108.      *
  109.      * @return \DateTime 
  110.      */
  111.     public function getDate()
  112.     {
  113.         return $this->date;
  114.     }
  115.     /**
  116.      * Set caracteristique
  117.      * @return Caracteristiqueplan
  118.      */
  119.     public function setCaracteristique(Caracteristique $caracteristique null): self
  120.     {
  121.         $this->caracteristique $caracteristique;
  122.         if($caracteristique != null)
  123.         {
  124.             $caracteristique->addCaracteristiqueproduit($this);
  125.         }
  126.         
  127.         return $this;
  128.     }
  129.     /**
  130.      * Get caracteristique
  131.      */
  132.     public function getCaracteristique(): ?Caracteristique
  133.     {
  134.         return $this->caracteristique;
  135.     }
  136.     /**
  137.      * Set user
  138.      * @return Caracteristiqueplan
  139.      */
  140.     public function setUser(User $user): self
  141.     {
  142.         $this->user $user;
  143.         return $this;
  144.     }
  145.     /**
  146.      * Get user
  147.      */
  148.     public function getUser(): ?User
  149.     {
  150.         return $this->user;
  151.     }
  152.     /**
  153.      * Set produit
  154.      * @return Caracteristiqueproduit
  155.      */
  156.     public function setProduit(Produit $produit null): self
  157.     {
  158.         $this->produit $produit;
  159.         if($produit != null)
  160.         {
  161.             $produit->addCaracteristiqueproduit($this);
  162.         }
  163.         return $this;
  164.     }
  165.     /**
  166.      * Get produit 
  167.      */
  168.     public function getProduit(): ?Produit
  169.     {
  170.         return $this->produit;
  171.     }
  172.     /**
  173.      * Set isChecked
  174.      *
  175.      * @param boolean $isChecked
  176.      * @return Produit
  177.      */
  178.     public function setIsChecked($isChecked)
  179.     {
  180.         $this->isChecked $isChecked;
  181.         return $this;
  182.     }
  183.     /**
  184.      * Get isChecked
  185.      *
  186.      * @return boolean 
  187.      */
  188.     public function getIsChecked()
  189.     {
  190.         return $this->isChecked;
  191.     }
  192. }