<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table(name: 'notification')]
class Notification
{
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: 'integer', unique: true)]
private $id;
#[ORM\Column(name: 'opened', type: 'boolean')]
protected $opened;
#[ORM\ManyToOne(targetEntity: 'App\Entity\User', inversedBy: "notifications")]
#[ORM\JoinColumn(name: 'owner', referencedColumnName: 'id')]
private $owner;
#[ORM\Column(type: 'string', length: 100)]
private $subject;
#[ORM\Column(type: 'integer')]
private $entityId;
#[ORM\Column(type: 'datetime', nullable: true)]
private $createdAt;
#[ORM\ManyToOne(targetEntity: Person::class)]
private $sender;
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @param int $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return User
*/
public function getOwner()
{
return $this->owner->getId();
}
/**
* @param User $owner
*/
public function setOwner($owner)
{
$this->owner = $owner;
}
/**
* @return bool
*/
public function isOpened()
{
return $this->opened;
}
/**
* @param bool $opened
*/
public function setOpened($opened)
{
$this->opened = $opened;
}
public function getSubject(): ?string
{
return $this->subject;
}
public function setSubject(string $subject): self
{
$this->subject = $subject;
return $this;
}
public function getEntityId(): ?int
{
return $this->entityId;
}
public function setEntityId(int $entityId): self
{
$this->entityId = $entityId;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getSender(): ?Person
{
return $this->sender;
}
public function setSender(?Person $sender): self
{
$this->sender = $sender;
return $this;
}
}