src/Entity/Product/ProductType.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Product;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Entity\Product\Famille;
  6. /**
  7.  * Product
  8.  *
  9.  * @ORM\Table(name="product_type")
  10.  * @ORM\Entity
  11.  */
  12. class ProductType
  13. {
  14.     /**
  15.      * @var int
  16.      *
  17.      * @ORM\Column(name="id", type="integer", nullable=false)
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="IDENTITY")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @var string
  24.      *
  25.      * @ORM\Column(name="name", type="string", nullable=false)
  26.      */
  27.     private $name;
  28.     /**
  29.      * @var Famille ArrayCollection
  30.      * @ORM\OneToMany(targetEntity=Famille::class, mappedBy="productType")
  31.      */
  32.     protected $familles;
  33.     public function __construct()
  34.     {
  35.         $this->familles = new ArrayCollection();
  36.     }
  37.     public function __toString()
  38.     {
  39.         return $this->name;
  40.     }
  41.     /**
  42.      * @return int
  43.      */
  44.     public function getId(): int
  45.     {
  46.         return $this->id;
  47.     }
  48.     /**
  49.      * @param int $id
  50.      */
  51.     public function setId(int $id): void
  52.     {
  53.         $this->id $id;
  54.     }
  55.     /**
  56.      * @return string
  57.      */
  58.     public function getName(): string
  59.     {
  60.         return $this->name;
  61.     }
  62.     /**
  63.      * @param string $name
  64.      */
  65.     public function setName(string $name): void
  66.     {
  67.         $this->name $name;
  68.     }
  69.     /**
  70.      * @return
  71.      */
  72.     public function getFamilles()
  73.     {
  74.         return $this->familles;
  75.     }
  76.     /**
  77.      * @param
  78.      */
  79.     public function setFamilles($familles): void
  80.     {
  81.         $this->familles $familles;
  82.     }
  83. }