<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity
* @ORM\Table(name="noticia")
*/
class Noticia
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $titulo;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $entrada;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $descripcion;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $contenido;
/**
* @ORM\Column(type="datetime", nullable=true, name="fecha_publicacion")
*/
private $fechaPublicacion;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $imagen;
/**
* @ORM\Column(type="array", nullable=true)
*/
private $estado;
/**
* @ORM\Column(type="datetime", nullable=true, name="fecha_noticia")
*/
private $fechaNoticia;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $publica;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $visibilidad;
/**
* @ORM\Column(type="datetime", nullable=true, name="deleted_at")
*/
private $deletedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2024-01-01 00:00:00"})
* @Gedmo\Timestampable(on="update")
*/
private $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2024-01-01 00:00:00"})
* @Gedmo\Timestampable(on="create")
*/
private $createdAt;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\Enlace::class, mappedBy="noticia")
*/
private $enlaces;
/**
* @ORM\ManyToOne(targetEntity=\App\Entity\CategoriaNoticia::class, inversedBy="noticias")
* @ORM\JoinColumn(name="categoria_noticia_id", referencedColumnName="id")
*/
private $categoriaNoticia;
public function __construct()
{
$this->enlaces = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
public function getTitulo(): ?string
{
return $this->titulo;
}
public function setTitulo(?string $titulo): static
{
$this->titulo = $titulo;
return $this;
}
public function getEntrada(): ?string
{
return $this->entrada;
}
public function setEntrada(?string $entrada): static
{
$this->entrada = $entrada;
return $this;
}
public function getDescripcion(): ?string
{
return $this->descripcion;
}
public function setDescripcion(?string $descripcion): static
{
$this->descripcion = $descripcion;
return $this;
}
public function getContenido(): ?string
{
return $this->contenido;
}
public function setContenido(?string $contenido): static
{
$this->contenido = $contenido;
return $this;
}
public function getFechaPublicacion(): ?\DateTimeInterface
{
return $this->fechaPublicacion;
}
public function setFechaPublicacion(?\DateTimeInterface $fechaPublicacion): static
{
$this->fechaPublicacion = $fechaPublicacion;
return $this;
}
public function getImagen(): ?string
{
return $this->imagen;
}
public function setImagen(?string $imagen): static
{
$this->imagen = $imagen;
return $this;
}
public function getEstado(): ?array
{
return $this->estado;
}
public function setEstado(?array $estado): static
{
$this->estado = $estado;
return $this;
}
public function getFechaNoticia(): ?\DateTimeInterface
{
return $this->fechaNoticia;
}
public function setFechaNoticia(?\DateTimeInterface $fechaNoticia): static
{
$this->fechaNoticia = $fechaNoticia;
return $this;
}
public function isPublica(): ?bool
{
return $this->publica;
}
public function setPublica(?bool $publica): static
{
$this->publica = $publica;
return $this;
}
public function isVisibilidad(): ?bool
{
return $this->visibilidad;
}
public function setVisibilidad(?bool $visibilidad): static
{
$this->visibilidad = $visibilidad;
return $this;
}
public function getDeletedAt(): ?\DateTimeInterface
{
return $this->deletedAt;
}
public function setDeletedAt(?\DateTimeInterface $deletedAt): static
{
$this->deletedAt = $deletedAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): static
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return Collection<int, Enlace>
*/
public function getEnlaces(): Collection
{
return $this->enlaces;
}
public function addEnlace(Enlace $enlace): static
{
if (!$this->enlaces->contains($enlace)) {
$this->enlaces->add($enlace);
$enlace->setNoticia($this);
}
return $this;
}
public function removeEnlace(Enlace $enlace): static
{
if ($this->enlaces->removeElement($enlace)) {
// set the owning side to null (unless already changed)
if ($enlace->getNoticia() === $this) {
$enlace->setNoticia(null);
}
}
return $this;
}
public function getCategoriaNoticia(): ?CategoriaNoticia
{
return $this->categoriaNoticia;
}
public function setCategoriaNoticia(?CategoriaNoticia $categoriaNoticia): static
{
$this->categoriaNoticia = $categoriaNoticia;
return $this;
}
}