src/CoreBundle/Entity/RelationTextbookElementImageReference.php line 18

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace CoreBundle\Entity;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity
  7. * @ORM\Table(
  8. * name="relation_textbook_element_image_reference",
  9. * uniqueConstraints={
  10. * @ORM\UniqueConstraint(name="uniq_element_image", columns={"textbook_element_id", "image_reference_id"})
  11. * }
  12. * )
  13. */
  14. class RelationTextbookElementImageReference
  15. {
  16. /**
  17. * @ORM\Id
  18. * @ORM\ManyToOne(targetEntity="TextbookElement", inversedBy="imageReferences")
  19. * @ORM\JoinColumn(name="textbook_element_id", referencedColumnName="id", nullable=false)
  20. */
  21. private TextbookElement $textbookElement;
  22. /**
  23. * @ORM\Id
  24. * @ORM\OneToOne(targetEntity="ImageReference", cascade={"remove"})
  25. * @ORM\JoinColumn(name="image_reference_id", referencedColumnName="id", unique=true, nullable=false)
  26. */
  27. private ImageReference $imageReference;
  28. /** @ORM\Column(type="integer") */
  29. private ?int $sorting;
  30. /** @ORM\Column(type="integer", nullable=true) */
  31. private ?int $width;
  32. public function getTextbookElement(): TextbookElement
  33. {
  34. return $this->textbookElement;
  35. }
  36. public function setTextbookElement($textbookElement): self
  37. {
  38. $this->textbookElement = $textbookElement;
  39. return $this;
  40. }
  41. public function getImageReference(): ImageReference
  42. {
  43. return $this->imageReference;
  44. }
  45. public function setImageReference($imageReference): self
  46. {
  47. $this->imageReference = $imageReference;
  48. return $this;
  49. }
  50. public function getSorting(): ?int
  51. {
  52. return $this->sorting;
  53. }
  54. public function setSorting(int $sorting): self
  55. {
  56. $this->sorting = $sorting;
  57. return $this;
  58. }
  59. public function getWidth(): ?int
  60. {
  61. return $this->width;
  62. }
  63. public function setWidth(?int $width): void
  64. {
  65. $this->width = $width;
  66. }
  67. }