src/Entity/Category.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CategoryRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=CategoryRepository::class)
  7.  */
  8. class Category
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(name="idCategory",type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="string", length=127)
  18.      */
  19.     private $name;
  20.     /**
  21.      * @ORM\OneToMany(targetEntity=Course::class, mappedBy="category", orphanRemoval=true)
  22.      */
  23.     private $courses;
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getName(): ?string
  29.     {
  30.         return $this->name;
  31.     }
  32.     public function setName(string $name): self
  33.     {
  34.         $this->name $name;
  35.         return $this;
  36.     }
  37.     /**
  38.      * Get the value of courses
  39.      */ 
  40.     public function getCourses()
  41.     {
  42.         return $this->courses;
  43.     }
  44.     /**
  45.      * Set the value of courses
  46.      *
  47.      * @return  self
  48.      */ 
  49.     public function setCourses($courses)
  50.     {
  51.         $this->courses $courses;
  52.         return $this;
  53.     }
  54. }