<?php
namespace Roothirsch\NotificationBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Roothirsch\CoreBundle\Entity\User;
use Roothirsch\NotificationBundle\Repository\NotificationReadOnRepository;
use Symfony\Component\Serializer\Annotation\Context;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
/**
* @ORM\Entity(repositoryClass=NotificationReadOnRepository::class)
*/
class NotificationReadOn
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\OneToOne(targetEntity=User::class, cascade={"persist", "remove"})
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\Column(type="datetime")
* @Context({"datetime_format":"U"})
*/
private $date;
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 getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
}