<?php
namespace App\Entity;
use App\Repository\TipoNotificacionRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TipoNotificacionRepository::class)
*/
class TipoNotificacion
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $nombre;
/**
* @ORM\OneToMany(targetEntity=Notificacion::class, mappedBy="tipoNotificacion")
*/
private $notificaciones;
public function __construct()
{
$this->notificaciones = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(string $nombre): self
{
$this->nombre = $nombre;
return $this;
}
/**
* @return Collection|Notificacion[]
*/
public function getNotificaciones(): Collection
{
return $this->notificaciones;
}
public function addNotificacione(Notificacion $notificacione): self
{
if (!$this->notificaciones->contains($notificacione)) {
$this->notificaciones[] = $notificacione;
$notificacione->setTipoNotificacion($this);
}
return $this;
}
public function removeNotificacione(Notificacion $notificacione): self
{
if ($this->notificaciones->contains($notificacione)) {
$this->notificaciones->removeElement($notificacione);
// set the owning side to null (unless already changed)
if ($notificacione->getTipoNotificacion() === $this) {
$notificacione->setTipoNotificacion(null);
}
}
return $this;
}
}