You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
800B

  1. <?php
  2. namespace Lc\SovBundle\Doctrine\Extension;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. trait TranslatableTrait
  6. {
  7. #[Gedmo\Locale]
  8. protected $locale;
  9. #[ORM\Column(type: 'array', nullable: true)]
  10. protected $localesEnabled = [];
  11. public function __get($name)
  12. {
  13. if (isset($this->{$name})) {
  14. return $this->{$name};
  15. } else {
  16. return null;
  17. }
  18. }
  19. public function setTranslatableLocale($locale)
  20. {
  21. $this->locale = $locale;
  22. }
  23. public function getLocalesEnabled(): ?array
  24. {
  25. return $this->localesEnabled;
  26. }
  27. public function setLocalesEnabled(?array $localesEnabled): self
  28. {
  29. $this->localesEnabled = $localesEnabled;
  30. return $this;
  31. }
  32. }