src/Entity/Core/RelationSelfStudyTypicalExamProblemElementImageReference.php line 13

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Core;
  4. use App\Entity\Core\SelfStudy\SelfStudyTypicalExamProblemElement;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity]
  7. #[ORM\Table(name: 'relation_self_study_typical_exam_problem_element_image_reference')]
  8. #[ORM\UniqueConstraint(name: 'uniq_self_study_typical_exam_problem_element_image', columns: ['self_study_typical_exam_problem_element_id', 'image_reference_id'])]
  9. class RelationSelfStudyTypicalExamProblemElementImageReference
  10. {
  11. #[ORM\Id]
  12. #[ORM\ManyToOne(targetEntity: SelfStudyTypicalExamProblemElement::class, inversedBy: 'imageReferences')]
  13. #[ORM\JoinColumn(name: 'self_study_typical_exam_problem_element_id', referencedColumnName: 'id', nullable: false)]
  14. private SelfStudyTypicalExamProblemElement $selfStudyTypicalExamProblemElement;
  15. #[ORM\Id]
  16. #[ORM\OneToOne(targetEntity: ImageReference::class, cascade: ['remove'])]
  17. #[ORM\JoinColumn(name: 'image_reference_id', referencedColumnName: 'id', unique: true, nullable: false)]
  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 getSelfStudyTypicalExamProblemElement(): SelfStudyTypicalExamProblemElement
  24. {
  25. return $this->selfStudyTypicalExamProblemElement;
  26. }
  27. /**
  28. * @return $this
  29. */
  30. public function setSelfStudyTypicalExamProblemElement(SelfStudyTypicalExamProblemElement $selfStudyTypicalExamProblemElement): self
  31. {
  32. $this->selfStudyTypicalExamProblemElement = $selfStudyTypicalExamProblemElement;
  33. return $this;
  34. }
  35. public function getImageReference(): ImageReference
  36. {
  37. return $this->imageReference;
  38. }
  39. /**
  40. * @return $this
  41. */
  42. public function setImageReference(ImageReference $imageReference): self
  43. {
  44. $this->imageReference = $imageReference;
  45. return $this;
  46. }
  47. public function getSorting(): ?int
  48. {
  49. return $this->sorting;
  50. }
  51. /**
  52. * @return $this
  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. }