<?phpnamespace App\Core\Entity;use App\Core\Repository\TutorialRepository;use App\Core\Entity\TutorialUsuario;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use phpDocumentor\Reflection\Types\Boolean;/** * @ORM\Entity(repositoryClass=TutorialRepository::class) */class Tutorial{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $textoEs; /** * @ORM\Column(type="string", length=255) */ private $textoEn; /** * @ORM\Column(type="string", length=255) */ private $ubicacion; /** * @ORM\Column(type="boolean") */ private $esInteractivo; /** * @ORM\Column(type="string", length=100, unique=true) */ private $nombreUnico; /** * @ORM\OneToMany(targetEntity=TutorialUsuario::class, mappedBy="tutorial", orphanRemoval=true) */ private $tutorialesUsuario; public function __construct() { $this->tutorialesUsuario = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getTexto() { if($GLOBALS['request']->getLocale() === 'es') return $this->textoEs; elseif ($GLOBALS['request']->getLocale() === 'en') return $this->textoEn; else return $this->textoEn; } public function getTextoEs(): ?string { return $this->textoEs; } public function setTextoEs(string $textoEs): self { $this->textoEs = $textoEs; return $this; } public function getTextoEn(): ?string { return $this->textoEn; } public function setTextoEn(string $textoEn): self { $this->textoEn = $textoEn; return $this; } public function getUbicacion(): ?string { return $this->ubicacion; } public function setUbicacion(string $ubicacion): self { $this->ubicacion = $ubicacion; return $this; } public function getEsInteractivo(): ?bool { return $this->esInteractivo; } public function setEsInteractivo(string $esInteractivo): self { $this->esInteractivo = $esInteractivo; return $this; } public function getNombreUnico(): ?string { return $this->nombreUnico; } public function setNombreUnico(string $nombreUnico): self { $this->nombreUnico = $nombreUnico; return $this; } /** * @return Collection|TutorialUsuario[] */ public function getTutorialesUsuario(): Collection { return $this->tutorialesUsuario; }}