<?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="calendario")
*/
class Calendario
{
/**
* @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"})
* @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\Evento::class, mappedBy="calendario")
*/
private $eventos;
/**
* @ORM\ManyToOne(targetEntity=\App\Entity\EntidadColaboradora::class, inversedBy="calendario")
* @ORM\JoinColumn(name="entidad_colaboradora_id", referencedColumnName="id")
*/
private $entidadColaboradora;
public function __construct()
{
$this->eventos = 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;
}
/**
* @return Collection<int, Evento>
*/
public function getEventos(): Collection
{
return $this->eventos;
}
public function addEvento(Evento $evento): static
{
if (!$this->eventos->contains($evento)) {
$this->eventos->add($evento);
$evento->setCalendario($this);
}
return $this;
}
public function removeEvento(Evento $evento): static
{
if ($this->eventos->removeElement($evento)) {
// set the owning side to null (unless already changed)
if ($evento->getCalendario() === $this) {
$evento->setCalendario(null);
}
}
return $this;
}
public function getEntidadColaboradora(): ?EntidadColaboradora
{
return $this->entidadColaboradora;
}
public function setEntidadColaboradora(?EntidadColaboradora $entidadColaboradora): static
{
$this->entidadColaboradora = $entidadColaboradora;
return $this;
}
}