<?php
namespace App\Core\Entity;
use App\Core\Entity\Curso;
use App\Core\Repository\NotificacionRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=NotificacionRepository::class)
*/
class Notificacion
{
CONST JSON_FIELDS = ['id', 'curso' => ['id', 'nombre'], 'titulo', 'texto', 'tipo','fecha', 'atributos', 'destinatario' => ['id'], 'vista', 'tituloEn', 'textoEn'];
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Curso::class, inversedBy="notificaciones")
*/
private $curso;
/**
* @ORM\Column(type="string", length=100, nullable=false)
*/
private $titulo;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private $texto;
/**
* @ORM\Column(type="string", length=50, nullable=false)
* @var string
*/
private $tipo;
/**
* @ORM\Column(type="datetime", nullable=false)
* @var \DateTime
*/
private $fecha;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="notificaciones")
*/
private $destinatario;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $atributos = [];
/**
* @ORM\Column(type="boolean")
*/
private $vista = false;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $estado;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $titulo_en;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $texto_en;
public function getId(): ?int
{
return $this->id;
}
public function getCurso(): ?Curso
{
return $this->curso;
}
public function setCurso(?Curso $curso): self
{
$this->curso = $curso;
return $this;
}
public function getDestinatario(): ?User
{
return $this->destinatario;
}
public function setDestinatario(?User $user): self
{
$this->destinatario = $user;
return $this;
}
public function getTexto(): ?string
{
return $this->texto;
}
public function setTexto(?string $texto): self
{
$this->texto = $texto;
return $this;
}
public function getAtributos(): ?array
{
return $this->atributos;
}
public function setAtributos(?array $atributos): self
{
$this->atributos = $atributos;
return $this;
}
public function getVista(): ?bool
{
return $this->vista;
}
public function setVista(bool $vista): self
{
$this->vista = $vista;
return $this;
}
/**
* @return string
*/
public function getTipo(): string
{
return $this->tipo;
}
/**
* @param string $tipo
*/
public function setTipo(string $tipo): void
{
$this->tipo = $tipo;
}
/**
* @return \DateTime
*/
public function getFecha(): \DateTime
{
return $this->fecha;
}
/**
* @param \DateTime $fecha
*/
public function setFecha(\DateTime $fecha): void
{
$this->fecha = $fecha;
}
/**
* @return string
*/
public function getTitulo(): string
{
return $this->titulo;
}
/**
* @param string $titulo
*/
public function setTitulo(string $titulo): void
{
$this->titulo = $titulo;
}
/**
* @return mixed
*/
public function getEstado(): ?int
{
return $this->estado;
}
/**
* @param mixed $estado
*/
public function setEstado($estado): void
{
$this->estado = $estado;
}
public function getTituloEn(): ?string
{
return $this->titulo_en;
}
public function setTituloEn(?string $titulo_en): self
{
$this->titulo_en = $titulo_en;
return $this;
}
public function getTextoEn(): ?string
{
return $this->texto_en;
}
public function setTextoEn(?string $texto_en): self
{
$this->texto_en = $texto_en;
return $this;
}
}