src/Entity/Element.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ElementRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\ORM\Mapping\DiscriminatorMap;
  6. use Doctrine\ORM\Mapping\InheritanceType;
  7. #[ORM\Entity(repositoryClassElementRepository::class)]
  8. #[InheritanceType('JOINED')]
  9. #[ORM\DiscriminatorColumn(name'type'type'string')]
  10. #[DiscriminatorMap(['Image' => Image::class, 'Paragraphe' => Paragraphe::class, 'CustomTable' => CustomTable::class])]
  11. class Element
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column]
  18.     private ?int $ordre null;
  19.     #[ORM\ManyToOne(inversedBy'elements')]
  20.     private ?Rubrique $rubrique null;
  21.     #[ORM\ManyToOne(inversedBy'elements')]
  22.     private ?Section $section null;
  23.     public function getId(): ?int
  24.     {
  25.         return $this->id;
  26.     }
  27.     public function getOrdre(): ?int
  28.     {
  29.         return $this->ordre;
  30.     }
  31.     public function setOrdre(int $ordre): static
  32.     {
  33.         $this->ordre $ordre;
  34.         return $this;
  35.     }
  36.     public function getRubrique(): ?Rubrique
  37.     {
  38.         return $this->rubrique;
  39.     }
  40.     public function setRubrique(?Rubrique $rubrique): static
  41.     {
  42.         $this->rubrique $rubrique;
  43.         return $this;
  44.     }
  45.     public function getSection(): ?Section
  46.     {
  47.         return $this->section;
  48.     }
  49.     public function setSection(?Section $section): static
  50.     {
  51.         $this->section $section;
  52.         return $this;
  53.     }
  54. }