<?php
declare(strict_types=1);
namespace CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(
* name="relation_textbook_element_image_reference",
* uniqueConstraints={
* @ORM\UniqueConstraint(name="uniq_element_image", columns={"textbook_element_id", "image_reference_id"})
* }
* )
*/
class RelationTextbookElementImageReference
{
/**
* @ORM\Id
* @ORM\ManyToOne(targetEntity="TextbookElement", inversedBy="imageReferences")
* @ORM\JoinColumn(name="textbook_element_id", referencedColumnName="id", nullable=false)
*/
private TextbookElement $textbookElement;
/**
* @ORM\Id
* @ORM\OneToOne(targetEntity="ImageReference", cascade={"remove"})
* @ORM\JoinColumn(name="image_reference_id", referencedColumnName="id", unique=true, nullable=false)
*/
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;
}
}