src/Entity/Core/RelationTextbookElementImageReference.php line 13

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