<?php
namespace App\Entity;
use App\Repository\NotificationsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=NotificationsRepository::class)
*/
class Notifications
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(onDelete="CASCADE")
*/
private $user;
/**
* @ORM\ManyToOne(targetEntity=Company::class)
* @ORM\JoinColumn(onDelete="CASCADE")
* @ORM\JoinColumn(nullable=false)
*/
private $company;
/**
* [1:Usuario, 2:Pieza, 3:Orden, 4:colab.ext., 5:bibliotecas]
*
* @ORM\Column(type="smallint")
*/
private $group_;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\Column(type="string", length=500)
*/
private $message;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $id_foreign;
/**
* @ORM\OneToMany(targetEntity=NotificationsSeen::class, mappedBy="notifications")
*/
private $notificationsSeens;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $reference;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $path_name;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $path_parameters;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $message_aux;
public function __construct()
{
$this->notificationsSeens = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getCompany(): ?Company
{
return $this->company;
}
public function setCompany(?Company $company): self
{
$this->company = $company;
return $this;
}
public function getGroup(): ?int
{
return $this->group_;
}
public function setGroup(int $group_): self
{
$this->group_ = $group_;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(string $message): self
{
$this->message = $message;
return $this;
}
public function getIdForeign(): ?int
{
return $this->id_foreign;
}
public function setIdForeign(?int $id_foreign): self
{
$this->id_foreign = $id_foreign;
return $this;
}
/**
* @return Collection<int, NotificationsSeen>
*/
public function getNotificationsSeens(): Collection
{
return $this->notificationsSeens;
}
public function addNotificationsSeen(NotificationsSeen $notificationsSeen): self
{
if (!$this->notificationsSeens->contains($notificationsSeen)) {
$this->notificationsSeens[] = $notificationsSeen;
$notificationsSeen->setNotifications($this);
}
return $this;
}
public function removeNotificationsSeen(NotificationsSeen $notificationsSeen): self
{
if ($this->notificationsSeens->removeElement($notificationsSeen)) {
// set the owning side to null (unless already changed)
if ($notificationsSeen->getNotifications() === $this) {
$notificationsSeen->setNotifications(null);
}
}
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getReference(): ?string
{
return $this->reference;
}
public function setReference(?string $reference): self
{
$this->reference = $reference;
return $this;
}
public function getPathName(): ?string
{
return $this->path_name;
}
public function setPathName(?string $path_name): self
{
$this->path_name = $path_name;
return $this;
}
public function getPathParameters(): ?string
{
return $this->path_parameters;
}
public function setPathParameters(?string $path_parameters): self
{
$this->path_parameters = $path_parameters;
return $this;
}
public function getMessageAux(): ?string
{
return $this->message_aux;
}
public function setMessageAux(?string $message_aux): self
{
$this->message_aux = $message_aux;
return $this;
}
}