vendor/roothirsch/tuer24-bundle/src/Entity/Tuer24ProductTranslation.php line 13

Open in your IDE?
  1. <?php
  2. namespace Roothirsch\Tuer24Bundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. #[ORM\Entity]
  7. #[ORM\Table(name: 'roothirsch_tuer24_product_translation')]
  8. #[ORM\UniqueConstraint(name: 'tuer24_product_translation_unique', columns: ['product_id', 'locale'])]
  9. #[UniqueEntity(fields: ['product', 'locale'])]
  10. class Tuer24ProductTranslation
  11. {
  12. #[ORM\Id]
  13. #[ORM\GeneratedValue]
  14. #[ORM\Column(type: 'integer')]
  15. private $id;
  16. #[ORM\ManyToOne(targetEntity: Tuer24Product::class, inversedBy: 'translations')]
  17. #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
  18. private $product;
  19. #[ORM\Column(type: 'string', length: 5)]
  20. #[Assert\NotBlank]
  21. #[Assert\Language]
  22. private $locale;
  23. #[ORM\Column(type: 'string', length: 255)]
  24. #[Assert\NotBlank]
  25. #[Assert\Length(max: 255)]
  26. private $title;
  27. #[ORM\Column(type: 'text', nullable: true)]
  28. private $shortDescription;
  29. #[ORM\Column(type: 'text', nullable: true)]
  30. private $description;
  31. /**
  32. * Get id
  33. *
  34. * @return int|null
  35. */
  36. public function getId(): ?int
  37. {
  38. return $this->id;
  39. }
  40. /**
  41. * Get product
  42. *
  43. * @return Tuer24Product|null
  44. */
  45. public function getProduct(): ?Tuer24Product
  46. {
  47. return $this->product;
  48. }
  49. /**
  50. * Set product
  51. *
  52. * @param Tuer24Product|null $product
  53. * @return $this
  54. */
  55. public function setProduct(?Tuer24Product $product): self
  56. {
  57. $this->product = $product;
  58. return $this;
  59. }
  60. /**
  61. * Get locale
  62. *
  63. * @return string|null
  64. */
  65. public function getLocale(): ?string
  66. {
  67. return $this->locale;
  68. }
  69. /**
  70. * Set locale
  71. *
  72. * @param string $locale
  73. * @return $this
  74. */
  75. public function setLocale(string $locale): self
  76. {
  77. $this->locale = $locale;
  78. return $this;
  79. }
  80. /**
  81. * Get title
  82. *
  83. * @return string|null
  84. */
  85. public function getTitle(): ?string
  86. {
  87. return $this->title;
  88. }
  89. /**
  90. * Set title
  91. *
  92. * @param string $title
  93. * @return $this
  94. */
  95. public function setTitle(string $title): self
  96. {
  97. $this->title = $title;
  98. return $this;
  99. }
  100. /**
  101. * Get short description
  102. *
  103. * @return string|null
  104. */
  105. public function getShortDescription(): ?string
  106. {
  107. return $this->shortDescription;
  108. }
  109. /**
  110. * Set short description
  111. *
  112. * @param string|null $shortDescription
  113. * @return $this
  114. */
  115. public function setShortDescription(?string $shortDescription): self
  116. {
  117. $this->shortDescription = $shortDescription;
  118. return $this;
  119. }
  120. /**
  121. * Get description
  122. *
  123. * @return string|null
  124. */
  125. public function getDescription(): ?string
  126. {
  127. return $this->description;
  128. }
  129. /**
  130. * Set description
  131. *
  132. * @param string|null $description
  133. * @return $this
  134. */
  135. public function setDescription(?string $description): self
  136. {
  137. $this->description = $description;
  138. return $this;
  139. }
  140. }