<?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;
/**
* @ORM\Entity
* @ORM\Table(name="chat")
*/
class Chat
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @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"})
*/
private $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2024-01-01 00:00:00"})
*/
private $createdAt;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $titulo;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $entidad;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $_sinLeer;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\ParticipanteChat::class, mappedBy="chat")
*/
private $participanteChats;
public function __construct()
{
$this->participanteChats = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
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 getTitulo(): ?string
{
return $this->titulo;
}
public function setTitulo(?string $titulo): static
{
$this->titulo = $titulo;
return $this;
}
public function getEntidad(): ?int
{
return $this->entidad;
}
public function setEntidad(?int $entidad): static
{
$this->entidad = $entidad;
return $this;
}
public function isSinLeer(): ?bool
{
return $this->_sinLeer;
}
public function setSinLeer(?bool $_sinLeer): static
{
$this->_sinLeer = $_sinLeer;
return $this;
}
/**
* @return Collection<int, ParticipanteChat>
*/
public function getParticipanteChats(): Collection
{
return $this->participanteChats;
}
public function addParticipanteChat(ParticipanteChat $participanteChat): static
{
if (!$this->participanteChats->contains($participanteChat)) {
$this->participanteChats->add($participanteChat);
}
return $this;
}
public function removeParticipanteChat(ParticipanteChat $participanteChat): static
{
$this->participanteChats->removeElement($participanteChat);
return $this;
}
}