<?php
namespace App\Entity;
use App\Enum\TipoAvisoEnum;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity
* @ORM\Table(name="aviso")
*/
class Aviso extends BaseEntity
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", nullable=true, enumType="App\Enum\TipoAvisoEnum")
*/
private $tipo;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $asunto;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $fecha;
/**
* @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\ManyToOne(targetEntity=\App\Entity\PropietarioContenido::class, inversedBy="avisos")
* @ORM\JoinColumn(name="propietario_contenido_id", referencedColumnName="id")
*/
private $propietarioContenido;
public function getId(): ?int
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
public function getTipo(): ?TipoAvisoEnum
{
return $this->tipo;// ? $this->tipo->label() : null;
}
public function setTipo(?TipoAvisoEnum $tipo): static
{
$this->tipo = $tipo;//TipoAvisoEnum::tryFrom($tipo);
return $this;
}
public function getAsunto(): ?string
{
return $this->asunto;
}
public function setAsunto(?string $asunto): static
{
$this->asunto = $asunto;
return $this;
}
public function getFecha(): ?\DateTimeInterface
{
return $this->fecha;
}
public function setFecha(?\DateTimeInterface $fecha): static
{
$this->fecha = $fecha;
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;
}
public function getPropietarioContenido(): ?PropietarioContenido
{
return $this->propietarioContenido;
}
public function setPropietarioContenido(?PropietarioContenido $propietarioContenido): static
{
$this->propietarioContenido = $propietarioContenido;
return $this;
}
}