<?php
namespace App\Entity;
use App\Repository\BlogRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=BlogRepository::class)
*/
class Blog
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $titulo;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $resumen;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $imagen_grande;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $imagen_listado;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $imagen_home;
/**
* @ORM\Column(type="boolean")
*/
private $destacado;
/**
* @ORM\Column(type="date")
*/
private $fecha;
/**
* @ORM\Column(type="boolean")
*/
private $visible;
/**
* @ORM\Column(type="text")
*/
private $contenido;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $created_at;
/**
* @ORM\ManyToOne(targetEntity=CategoriaBlog::class)
*/
private $categoria;
public function __toString()
{
return $this->getTitulo();
}
public function __construct()
{
$this->created_at = new \DateTimeImmutable();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitulo(): ?string
{
return $this->titulo;
}
public function setTitulo(string $titulo): self
{
$this->titulo = $titulo;
return $this;
}
public function getResumen(): ?string
{
return $this->resumen;
}
public function setResumen(?string $resumen): self
{
$this->resumen = $resumen;
return $this;
}
public function getImagenGrande(): ?string
{
return $this->imagen_grande;
}
public function setImagenGrande(string $imagen_grande): self
{
$this->imagen_grande = $imagen_grande;
return $this;
}
public function getImagenListado(): ?string
{
return $this->imagen_listado;
}
public function setImagenListado(?string $imagen_listado): self
{
$this->imagen_listado = $imagen_listado;
return $this;
}
public function getImagenHome(): ?string
{
return $this->imagen_home;
}
public function setImagenHome(?string $imagen_home): self
{
$this->imagen_home = $imagen_home;
return $this;
}
public function getDestacado(): ?bool
{
return $this->destacado;
}
public function setDestacado(bool $destacado): self
{
$this->destacado = $destacado;
return $this;
}
public function getFecha(): ?\DateTimeInterface
{
return $this->fecha;
}
public function setFecha(\DateTimeInterface $fecha): self
{
$this->fecha = $fecha;
return $this;
}
public function getVisible(): ?bool
{
return $this->visible;
}
public function setVisible(bool $visible): self
{
$this->visible = $visible;
return $this;
}
public function getContenido(): ?string
{
return $this->contenido;
}
public function setContenido(string $contenido): self
{
$this->contenido = $contenido;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeImmutable $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getCategoria(): ?CategoriaBlog
{
return $this->categoria;
}
public function setCategoria(?CategoriaBlog $categoria): self
{
$this->categoria = $categoria;
return $this;
}
}