src/Entity/Lessons.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Repository\LessonsRepository;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. #[ORM\Entity]
  7. //#[ORM\Entity(repositoryClass: LessonsRepository::class)]
  8. #[ORM\Table(name"lessons"indexes: [new ORM\Index(name"coursId"columns: ["coursId"])])]
  9. class Lessons
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue(strategy"IDENTITY")]
  13.     #[ORM\Column(name"id"type"integer")]
  14.     private ?int $id null;
  15.     #[Assert\NotBlank]
  16.     #[ORM\Column(name"titre"type"string"length80)]
  17.     private ?string $titre null;
  18.     #[Assert\NotBlank]
  19.     #[ORM\Column(name"content"type"text")]
  20.     private ?string $content null;
  21.     #[Assert\NotNull]
  22.     #[Assert\Positive]
  23.     #[ORM\Column(name"duree"type"integer"nullabletrue)]
  24.     private ?int $duree null;
  25.     #[ORM\Column(name"image"type"string"length255nullabletrue)]
  26.     private ?string $image null;
  27.     #[Assert\Url]
  28.     #[ORM\Column(name"video"type"string"length80nullabletrue)]
  29.     private ?string $video null;
  30.    
  31.     #[Assert\Positive]
  32.     #[ORM\Column(name"classement"type"integer")]
  33.     private ?int $classement 0;
  34.     #[ORM\ManyToOne(targetEntityCours::class)]
  35.     #[ORM\JoinColumn(name"coursId"referencedColumnName"id")]
  36.     private ?Cours $coursid null;
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getTitre(): ?string
  42.     {
  43.         return $this->titre;
  44.     }
  45.     public function setTitre(string $titre): static
  46.     {
  47.         $this->titre $titre;
  48.         return $this;
  49.     }
  50.     public function getContent(): ?string
  51.     {
  52.         return $this->content;
  53.     }
  54.     public function setContent(string $content): static
  55.     {
  56.         $this->content $content;
  57.         return $this;
  58.     }
  59.     public function getDuree(): ?int
  60.     {
  61.         return $this->duree;
  62.     }
  63.     public function setDuree(?int $duree): static
  64.     {
  65.         $this->duree $duree;
  66.         return $this;
  67.     }
  68.     public function getImage(): ?string
  69.     {
  70.         return $this->image;
  71.     }
  72.     public function setImage(?string $image): static
  73.     {
  74.         $this->image $image;
  75.         return $this;
  76.     }
  77.     public function getVideo(): ?string
  78.     {
  79.         return $this->video;
  80.     }
  81.     public function setVideo(?string $video): static
  82.     {
  83.         $this->video $video;
  84.         return $this;
  85.     }
  86.     public function getClassement(): ?int
  87.     {
  88.         return $this->classement;
  89.     }
  90.     public function setClassement(int $classement): static
  91.     {
  92.         $this->classement $classement;
  93.         return $this;
  94.     }
  95.     public function getCoursid(): ?Cours
  96.     {
  97.         return $this->coursid;
  98.     }
  99.     public function setCoursid(?Cours $coursid): static
  100.     {
  101.         $this->coursid $coursid;
  102.         return $this;
  103.     }
  104. }