<?php
namespace App\Entity;
use App\Repository\ElementRepository;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\DiscriminatorMap;
use Doctrine\ORM\Mapping\InheritanceType;
#[ORM\Entity(repositoryClass: ElementRepository::class)]
#[InheritanceType('JOINED')]
#[ORM\DiscriminatorColumn(name: 'type', type: 'string')]
#[DiscriminatorMap(['Image' => Image::class, 'Paragraphe' => Paragraphe::class, 'CustomTable' => CustomTable::class])]
class Element
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column]
private ?int $ordre = null;
#[ORM\ManyToOne(inversedBy: 'elements')]
private ?Rubrique $rubrique = null;
#[ORM\ManyToOne(inversedBy: 'elements')]
private ?Section $section = null;
public function getId(): ?int
{
return $this->id;
}
public function getOrdre(): ?int
{
return $this->ordre;
}
public function setOrdre(int $ordre): static
{
$this->ordre = $ordre;
return $this;
}
public function getRubrique(): ?Rubrique
{
return $this->rubrique;
}
public function setRubrique(?Rubrique $rubrique): static
{
$this->rubrique = $rubrique;
return $this;
}
public function getSection(): ?Section
{
return $this->section;
}
public function setSection(?Section $section): static
{
$this->section = $section;
return $this;
}
}