src/Entity/Ressources.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Repository\RessourcesRepository;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. #[ORM\Entity]
  7. //#[ORM\Entity(repositoryClass: RessourcesRepository::class)]
  8. #[ORM\Table(name"ressources"indexes: [new ORM\Index(name"coursId"columns: ["coursId"])])]
  9. class Ressources
  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"lien"type"string"length250)]
  17.     private ?string $lien null;
  18.     #[Assert\NotBlank]
  19.     #[ORM\Column(name"type"type"string"length60)]
  20.     private ?string $type null;
  21.     #[ORM\OneToOne(targetEntityCours::class)]
  22.     #[ORM\JoinColumn(name"coursId"referencedColumnName"id")]
  23.     private ?Cours $coursid null;
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getLien(): ?string
  29.     {
  30.         return $this->lien;
  31.     }
  32.     public function setLien(string $lien): static
  33.     {
  34.         $this->lien $lien;
  35.         return $this;
  36.     }
  37.     public function getType(): ?string
  38.     {
  39.         return $this->type;
  40.     }
  41.     public function setType(string $type): static
  42.     {
  43.         $this->type $type;
  44.         return $this;
  45.     }
  46.     public function getCoursid(): ?Cours
  47.     {
  48.         return $this->coursid;
  49.     }
  50.     public function setCoursid(?Cours $coursid): static
  51.     {
  52.         $this->coursid $coursid;
  53.         return $this;
  54.     }
  55. }