src/Entity/Web/NewsStoreTranslation.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Web;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Entity\Behaviors\TranslationTrait;
  5. use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface;
  6. /**
  7. * @ORM\Table(name="web_news_stores_translation")
  8. * @ORM\Entity(repositoryClass="App\Repository\TranslationRepository")
  9. * @ORM\EntityListeners({"App\Listener\EntityListener"})
  10. */
  11. class NewsStoreTranslation implements TranslationInterface
  12. {
  13. use TranslationTrait;
  14. /**
  15. * @ORM\Column(type="string", length=2)
  16. */
  17. protected $locale;
  18. /**
  19. * @ORM\Column(type="text", nullable=true)
  20. */
  21. private ?string $text = '';
  22. /**
  23. * @ORM\Column(type="string", length=100, nullable=true)
  24. */
  25. private ?string $label = '';
  26. public function __construct($locale = null) {
  27. if($locale !== null){
  28. $this->setLocale($locale);
  29. }
  30. }
  31. public function getId(): ?int
  32. {
  33. return $this->id;
  34. }
  35. public function getText(): ?string
  36. {
  37. return $this->text;
  38. }
  39. public function setText($text): self
  40. {
  41. $this->text = $text;
  42. return $this;
  43. }
  44. public function getLabel(): ?string
  45. {
  46. return $this->label;
  47. }
  48. public function setLabel(?string $label): self
  49. {
  50. $this->label = $label;
  51. return $this;
  52. }
  53. }