<?php
namespace Roothirsch\NotificationBundle\Entity;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
use ApiPlatform\Core\Annotation\ApiResource;
use Roothirsch\NotificationBundle\API\FetchController;
use Roothirsch\NotificationBundle\API\ReadController;
use Roothirsch\NotificationBundle\API\CheckController;
use Roothirsch\NotificationBundle\Repository\NotificationRepository;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ApiResource(
* collectionOperations={
* "get"
* },
* itemOperations={
* "get"
* }
* )
* @ORM\Entity(repositoryClass=NotificationRepository::class)
*/
class Notification
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Gedmo\Translatable
*/
private $title;
/**
* @ORM\Column(type="text", nullable=true)
* @Gedmo\Translatable
*/
private $content;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $createdAt;
public function __construct()
{
$this->createdAt = new \DateTimeImmutable();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(string $content): self
{
$this->content = $content;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
}