src/Core/Entity/Tutorial.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Core\Entity;
  3. use App\Core\Repository\TutorialRepository;
  4. use App\Core\Entity\TutorialUsuario;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use phpDocumentor\Reflection\Types\Boolean;
  9. /**
  10. * @ORM\Entity(repositoryClass=TutorialRepository::class)
  11. */
  12. class Tutorial
  13. {
  14. /**
  15. * @ORM\Id
  16. * @ORM\GeneratedValue
  17. * @ORM\Column(type="integer")
  18. */
  19. private $id;
  20. /**
  21. * @ORM\Column(type="string", length=255)
  22. */
  23. private $textoEs;
  24. /**
  25. * @ORM\Column(type="string", length=255)
  26. */
  27. private $textoEn;
  28. /**
  29. * @ORM\Column(type="string", length=255)
  30. */
  31. private $ubicacion;
  32. /**
  33. * @ORM\Column(type="boolean")
  34. */
  35. private $esInteractivo;
  36. /**
  37. * @ORM\Column(type="string", length=100, unique=true)
  38. */
  39. private $nombreUnico;
  40. /**
  41. * @ORM\OneToMany(targetEntity=TutorialUsuario::class, mappedBy="tutorial", orphanRemoval=true)
  42. */
  43. private $tutorialesUsuario;
  44. public function __construct() {
  45. $this->tutorialesUsuario = new ArrayCollection();
  46. }
  47. public function getId(): ?int
  48. {
  49. return $this->id;
  50. }
  51. public function getTexto() {
  52. if($GLOBALS['request']->getLocale() === 'es')
  53. return $this->textoEs;
  54. elseif ($GLOBALS['request']->getLocale() === 'en')
  55. return $this->textoEn;
  56. else
  57. return $this->textoEn;
  58. }
  59. public function getTextoEs(): ?string
  60. {
  61. return $this->textoEs;
  62. }
  63. public function setTextoEs(string $textoEs): self
  64. {
  65. $this->textoEs = $textoEs;
  66. return $this;
  67. }
  68. public function getTextoEn(): ?string
  69. {
  70. return $this->textoEn;
  71. }
  72. public function setTextoEn(string $textoEn): self
  73. {
  74. $this->textoEn = $textoEn;
  75. return $this;
  76. }
  77. public function getUbicacion(): ?string
  78. {
  79. return $this->ubicacion;
  80. }
  81. public function setUbicacion(string $ubicacion): self
  82. {
  83. $this->ubicacion = $ubicacion;
  84. return $this;
  85. }
  86. public function getEsInteractivo(): ?bool
  87. {
  88. return $this->esInteractivo;
  89. }
  90. public function setEsInteractivo(string $esInteractivo): self
  91. {
  92. $this->esInteractivo = $esInteractivo;
  93. return $this;
  94. }
  95. public function getNombreUnico(): ?string
  96. {
  97. return $this->nombreUnico;
  98. }
  99. public function setNombreUnico(string $nombreUnico): self
  100. {
  101. $this->nombreUnico = $nombreUnico;
  102. return $this;
  103. }
  104. /**
  105. * @return Collection|TutorialUsuario[]
  106. */
  107. public function getTutorialesUsuario(): Collection
  108. {
  109. return $this->tutorialesUsuario;
  110. }
  111. }