src/Entity/Notifications.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\NotificationsRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=NotificationsRepository::class)
  9.  */
  10. class Notifications
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=User::class)
  20.      * @ORM\JoinColumn(onDelete="CASCADE")
  21.      */
  22.     private $user;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=Company::class)
  25.      * @ORM\JoinColumn(onDelete="CASCADE")
  26.      * @ORM\JoinColumn(nullable=false)
  27.      */
  28.     private $company;
  29.     /**
  30.      * [1:Usuario, 2:Pieza, 3:Orden, 4:colab.ext., 5:bibliotecas]
  31.      * 
  32.      * @ORM\Column(type="smallint")
  33.      */
  34.     private $group_;
  35.     /**
  36.      * @ORM\Column(type="datetime")
  37.      */
  38.     private $created_at;
  39.     /**
  40.      * @ORM\Column(type="string", length=500)
  41.      */
  42.     private $message;
  43.     /**
  44.      * @ORM\Column(type="integer", nullable=true)
  45.      */
  46.     private $id_foreign;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity=NotificationsSeen::class, mappedBy="notifications")
  49.      */
  50.     private $notificationsSeens;
  51.     /**
  52.      * @ORM\Column(type="string", length=255, nullable=true)
  53.      */
  54.     private $name;
  55.     /**
  56.      * @ORM\Column(type="string", length=255, nullable=true)
  57.      */
  58.     private $reference;
  59.     /**
  60.      * @ORM\Column(type="string", length=50, nullable=true)
  61.      */
  62.     private $path_name;
  63.     /**
  64.      * @ORM\Column(type="string", length=255, nullable=true)
  65.      */
  66.     private $path_parameters;
  67.     /**
  68.      * @ORM\Column(type="string", length=255, nullable=true)
  69.      */
  70.     private $message_aux;
  71.     public function __construct()
  72.     {
  73.         $this->notificationsSeens = new ArrayCollection();
  74.     }
  75.     public function getId(): ?int
  76.     {
  77.         return $this->id;
  78.     }
  79.     public function getUser(): ?User
  80.     {
  81.         return $this->user;
  82.     }
  83.     public function setUser(?User $user): self
  84.     {
  85.         $this->user $user;
  86.         return $this;
  87.     }
  88.     public function getCompany(): ?Company
  89.     {
  90.         return $this->company;
  91.     }
  92.     public function setCompany(?Company $company): self
  93.     {
  94.         $this->company $company;
  95.         return $this;
  96.     }
  97.     public function getGroup(): ?int
  98.     {
  99.         return $this->group_;
  100.     }
  101.     public function setGroup(int $group_): self
  102.     {
  103.         $this->group_ $group_;
  104.         return $this;
  105.     }
  106.     public function getCreatedAt(): ?\DateTimeInterface
  107.     {
  108.         return $this->created_at;
  109.     }
  110.     public function setCreatedAt(\DateTimeInterface $created_at): self
  111.     {
  112.         $this->created_at $created_at;
  113.         return $this;
  114.     }
  115.     public function getMessage(): ?string
  116.     {
  117.         return $this->message;
  118.     }
  119.     public function setMessage(string $message): self
  120.     {
  121.         $this->message $message;
  122.         return $this;
  123.     }
  124.     public function getIdForeign(): ?int
  125.     {
  126.         return $this->id_foreign;
  127.     }
  128.     public function setIdForeign(?int $id_foreign): self
  129.     {
  130.         $this->id_foreign $id_foreign;
  131.         return $this;
  132.     }
  133.     /**
  134.      * @return Collection<int, NotificationsSeen>
  135.      */
  136.     public function getNotificationsSeens(): Collection
  137.     {
  138.         return $this->notificationsSeens;
  139.     }
  140.     public function addNotificationsSeen(NotificationsSeen $notificationsSeen): self
  141.     {
  142.         if (!$this->notificationsSeens->contains($notificationsSeen)) {
  143.             $this->notificationsSeens[] = $notificationsSeen;
  144.             $notificationsSeen->setNotifications($this);
  145.         }
  146.         return $this;
  147.     }
  148.     public function removeNotificationsSeen(NotificationsSeen $notificationsSeen): self
  149.     {
  150.         if ($this->notificationsSeens->removeElement($notificationsSeen)) {
  151.             // set the owning side to null (unless already changed)
  152.             if ($notificationsSeen->getNotifications() === $this) {
  153.                 $notificationsSeen->setNotifications(null);
  154.             }
  155.         }
  156.         return $this;
  157.     }
  158.     public function getName(): ?string
  159.     {
  160.         return $this->name;
  161.     }
  162.     public function setName(?string $name): self
  163.     {
  164.         $this->name $name;
  165.         return $this;
  166.     }
  167.     public function getReference(): ?string
  168.     {
  169.         return $this->reference;
  170.     }
  171.     public function setReference(?string $reference): self
  172.     {
  173.         $this->reference $reference;
  174.         return $this;
  175.     }
  176.     public function getPathName(): ?string
  177.     {
  178.         return $this->path_name;
  179.     }
  180.     public function setPathName(?string $path_name): self
  181.     {
  182.         $this->path_name $path_name;
  183.         return $this;
  184.     }
  185.     public function getPathParameters(): ?string
  186.     {
  187.         return $this->path_parameters;
  188.     }
  189.     public function setPathParameters(?string $path_parameters): self
  190.     {
  191.         $this->path_parameters $path_parameters;
  192.         return $this;
  193.     }
  194.     public function getMessageAux(): ?string
  195.     {
  196.         return $this->message_aux;
  197.     }
  198.     public function setMessageAux(?string $message_aux): self
  199.     {
  200.         $this->message_aux $message_aux;
  201.         return $this;
  202.     }
  203. }