<?php
declare(strict_types=1);
namespace App\Entity\Core;
use App\Entity\Core\Textbook\TextbookElement;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'relation_textbook_element_image_reference')]
#[ORM\UniqueConstraint(name: 'uniq_element_image', columns: ['textbook_element_id', 'image_reference_id'])]
#[ORM\Entity]
class RelationTextbookElementImageReference
{
#[ORM\JoinColumn(name: 'textbook_element_id', referencedColumnName: 'id', nullable: false)]
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: TextbookElement::class, inversedBy: 'imageReferences')]
private TextbookElement $textbookElement;
#[ORM\JoinColumn(name: 'image_reference_id', referencedColumnName: 'id', unique: true, nullable: false)]
#[ORM\Id]
#[ORM\OneToOne(targetEntity: ImageReference::class, cascade: ['remove'])]
private ImageReference $imageReference;
#[ORM\Column(type: 'integer')]
private ?int $sorting;
#[ORM\Column(type: 'integer', nullable: true)]
private ?int $width;
public function getTextbookElement(): TextbookElement
{
return $this->textbookElement;
}
public function setTextbookElement($textbookElement): self
{
$this->textbookElement = $textbookElement;
return $this;
}
public function getImageReference(): ImageReference
{
return $this->imageReference;
}
public function setImageReference($imageReference): self
{
$this->imageReference = $imageReference;
return $this;
}
public function getSorting(): ?int
{
return $this->sorting;
}
public function setSorting(int $sorting): self
{
$this->sorting = $sorting;
return $this;
}
public function getWidth(): ?int
{
return $this->width;
}
public function setWidth(?int $width): void
{
$this->width = $width;
}
}