- Rename `read` column to `is_read` (PostgreSQL reserved word) - Wrap navbar + modal in parent div for Stimulus controller scope - Set temporary filePath before first flush in ImportController - Use RETURNING clause for atomic incrementProcessedBatches - Return proper empty 204 response in NotificationController Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
79 lines
1.5 KiB
PHP
79 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Entity;
|
|
|
|
use App\Repository\NotificationRepository;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
#[ORM\Entity(repositoryClass: NotificationRepository::class)]
|
|
class Notification
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\Column]
|
|
private ?int $id = null;
|
|
|
|
#[ORM\ManyToOne(targetEntity: User::class)]
|
|
#[ORM\JoinColumn(nullable: false)]
|
|
private ?User $user = null;
|
|
|
|
#[ORM\Column(length: 255)]
|
|
private ?string $message = null;
|
|
|
|
#[ORM\Column(name: 'is_read')]
|
|
private bool $read = false;
|
|
|
|
#[ORM\Column]
|
|
private \DateTimeImmutable $createdAt;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->createdAt = new \DateTimeImmutable();
|
|
}
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getUser(): ?User
|
|
{
|
|
return $this->user;
|
|
}
|
|
|
|
public function setUser(?User $user): static
|
|
{
|
|
$this->user = $user;
|
|
return $this;
|
|
}
|
|
|
|
public function getMessage(): ?string
|
|
{
|
|
return $this->message;
|
|
}
|
|
|
|
public function setMessage(string $message): static
|
|
{
|
|
$this->message = $message;
|
|
return $this;
|
|
}
|
|
|
|
public function isRead(): bool
|
|
{
|
|
return $this->read;
|
|
}
|
|
|
|
public function setRead(bool $read): static
|
|
{
|
|
$this->read = $read;
|
|
return $this;
|
|
}
|
|
|
|
public function getCreatedAt(): \DateTimeImmutable
|
|
{
|
|
return $this->createdAt;
|
|
}
|
|
}
|