vendor/roothirsch/tuer24-bundle/src/Entity/Tuer24CategoryTranslation.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_category_translation')]
  8. #[ORM\UniqueConstraint(name: 'tuer24_category_translation_unique', columns: ['category_id', 'locale'])]
  9. #[UniqueEntity(fields: ['category', 'locale'])]
  10. class Tuer24CategoryTranslation
  11. {
  12. #[ORM\Id]
  13. #[ORM\GeneratedValue]
  14. #[ORM\Column(type: 'integer')]
  15. private $id;
  16. #[ORM\ManyToOne(targetEntity: "Tuer24Category", inversedBy: "translations")]
  17. #[ORM\JoinColumn(nullable: false, onDelete: "CASCADE")]
  18. private $category;
  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 $name;
  27. #[ORM\Column(type: 'text', nullable: true)]
  28. private $description;
  29. /**
  30. * Get id
  31. *
  32. * @return int|null
  33. */
  34. public function getId(): ?int
  35. {
  36. return $this->id;
  37. }
  38. /**
  39. * Get category
  40. *
  41. * @return Tuer24Category|null
  42. */
  43. public function getCategory(): ?Tuer24Category
  44. {
  45. return $this->category;
  46. }
  47. /**
  48. * Set category
  49. *
  50. * @param Tuer24Category|null $category
  51. * @return $this
  52. */
  53. public function setCategory(?Tuer24Category $category): self
  54. {
  55. $this->category = $category;
  56. return $this;
  57. }
  58. /**
  59. * Get locale
  60. *
  61. * @return string|null
  62. */
  63. public function getLocale(): ?string
  64. {
  65. return $this->locale;
  66. }
  67. /**
  68. * Set locale
  69. *
  70. * @param string $locale
  71. * @return $this
  72. */
  73. public function setLocale(string $locale): self
  74. {
  75. $this->locale = $locale;
  76. return $this;
  77. }
  78. /**
  79. * Get name
  80. *
  81. * @return string|null
  82. */
  83. public function getName(): ?string
  84. {
  85. return $this->name;
  86. }
  87. /**
  88. * Set name
  89. *
  90. * @param string $name
  91. * @return $this
  92. */
  93. public function setName(string $name): self
  94. {
  95. $this->name = $name;
  96. return $this;
  97. }
  98. /**
  99. * Get description
  100. *
  101. * @return string|null
  102. */
  103. public function getDescription(): ?string
  104. {
  105. return $this->description;
  106. }
  107. /**
  108. * Set description
  109. *
  110. * @param string|null $description
  111. * @return $this
  112. */
  113. public function setDescription(?string $description): self
  114. {
  115. $this->description = $description;
  116. return $this;
  117. }
  118. }