<?php
namespace App\Core\Entity;
use App\Core\Repository\AgendaRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\OrderBy;
/**
* @ORM\Entity(repositoryClass=AgendaRepository::class)
*/
class Agenda
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\OneToMany(targetEntity=RecordatorioAgenda::class, mappedBy="agenda", orphanRemoval=true)
* @OrderBy({"fecha" = "ASC"})
*/
private $recordatoriosAgenda;
public function __construct()
{
$this->recordatoriosAgenda = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
/**
* @return Collection|RecordatorioAgenda[]
*/
public function getRecordatoriosAgenda(): Collection
{
return $this->recordatoriosAgenda;
}
public function addRecordatoriosAgenda(RecordatorioAgenda $recordatoriosAgenda): self
{
if (!$this->recordatoriosAgenda->contains($recordatoriosAgenda)) {
$this->recordatoriosAgenda[] = $recordatoriosAgenda;
$recordatoriosAgenda->setAgenda($this);
}
return $this;
}
public function removeRecordatoriosAgenda(RecordatorioAgenda $recordatoriosAgenda): self
{
if ($this->recordatoriosAgenda->contains($recordatoriosAgenda)) {
$this->recordatoriosAgenda->removeElement($recordatoriosAgenda);
// set the owning side to null (unless already changed)
if ($recordatoriosAgenda->getAgenda() === $this) {
$recordatoriosAgenda->setAgenda(null);
}
}
return $this;
}
}