src/Entity/Notification.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. #[ORM\Entity]
  5. #[ORM\Table(name'notification')]
  6. class Notification
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue(strategy'AUTO')]
  10.     #[ORM\Column(type'integer'uniquetrue)]
  11.     private $id;
  12.     #[ORM\Column(name'opened'type'boolean')]
  13.     protected $opened;
  14.     #[ORM\ManyToOne(targetEntity'App\Entity\User'inversedBy"notifications")]
  15.     #[ORM\JoinColumn(name'owner'referencedColumnName'id')]
  16.     private $owner;
  17.     #[ORM\Column(type'string'length100)]
  18.     private $subject;
  19.     #[ORM\Column(type'integer')]
  20.     private $entityId;
  21.     #[ORM\Column(type'datetime'nullabletrue)]
  22.     private $createdAt;
  23.     #[ORM\ManyToOne(targetEntityPerson::class)]
  24.     private $sender;
  25.     /**
  26.      * @return int
  27.      */
  28.     public function getId()
  29.     {
  30.         return $this->id;
  31.     }
  32.     /**
  33.      * @param int $id
  34.      */
  35.     public function setId($id)
  36.     {
  37.         $this->id $id;
  38.     }
  39.     /**
  40.      * @return User
  41.      */
  42.     public function getOwner()
  43.     {
  44.         return $this->owner->getId();
  45.     }
  46.     /**
  47.      * @param User $owner
  48.      */
  49.     public function setOwner($owner)
  50.     {
  51.         $this->owner $owner;
  52.     }
  53.     /**
  54.      * @return bool
  55.      */
  56.     public function isOpened()
  57.     {
  58.         return $this->opened;
  59.     }
  60.     /**
  61.      * @param bool $opened
  62.      */
  63.     public function setOpened($opened)
  64.     {
  65.         $this->opened $opened;
  66.     }
  67.     public function getSubject(): ?string
  68.     {
  69.         return $this->subject;
  70.     }
  71.     public function setSubject(string $subject): self
  72.     {
  73.         $this->subject $subject;
  74.         return $this;
  75.     }
  76.     public function getEntityId(): ?int
  77.     {
  78.         return $this->entityId;
  79.     }
  80.     public function setEntityId(int $entityId): self
  81.     {
  82.         $this->entityId $entityId;
  83.         return $this;
  84.     }
  85.     public function getCreatedAt(): ?\DateTimeInterface
  86.     {
  87.         return $this->createdAt;
  88.     }
  89.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  90.     {
  91.         $this->createdAt $createdAt;
  92.         return $this;
  93.     }
  94.     public function getSender(): ?Person
  95.     {
  96.         return $this->sender;
  97.     }
  98.     public function setSender(?Person $sender): self
  99.     {
  100.         $this->sender $sender;
  101.         return $this;
  102.     }
  103. }