src/Entity/Courses.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CoursesRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. /**
  7.  * @ORM\Entity(repositoryClass=CoursesRepository::class)
  8.  */
  9. class Courses {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="string", length=255, nullable=true)
  18.      */
  19.     private $name;
  20.     /**
  21.      * @ORM\Column(type="string", length=255, nullable=true)
  22.      */
  23.     private $description;
  24.     /**
  25.      * @ORM\Column(type="string", length=10, nullable=true)
  26.      */
  27.     private $abreviature;
  28.     /**
  29.      * @ORM\OneToMany(targetEntity="StudentCourse", mappedBy="course")
  30.      */
  31.     protected $students;
  32.     public function __construct() {
  33.         $this->students = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int {
  36.         return $this->id;
  37.     }
  38.     public function getName(): ?string {
  39.         return $this->name;
  40.     }
  41.     public function setName(?string $name): self {
  42.         $this->name $name;
  43.         return $this;
  44.     }
  45.     public function getDescription(): ?string {
  46.         return $this->description;
  47.     }
  48.     public function setDescription(?string $description): self {
  49.         $this->description $description;
  50.         return $this;
  51.     }
  52.     public function getAbreviature() {
  53.         return $this->abreviature;
  54.     }
  55.     public function setAbreviature($abreviature): void {
  56.         $this->abreviature $abreviature;
  57.     }
  58.     public function __toString() {
  59.         return $this->getName();
  60.     }
  61.     public function getStudentCourses() {
  62.         return $this->students;
  63.     }
  64.     public function setStudentCourses($studentCourses): void {
  65.         $this->students $studentCourses;
  66.     }
  67. }