can write and read notes

This commit is contained in:
2025-05-17 22:47:20 +01:00
parent a8d5c4dcdb
commit 6327c3509e
12 changed files with 352 additions and 4 deletions

66
src/Entity/Note.php Normal file
View File

@@ -0,0 +1,66 @@
<?php
namespace App\Entity;
use App\Repository\NoteRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: NoteRepository::class)]
class Note
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $content = null;
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?\DateTime $published_date = null;
#[ORM\Column(length: 255)]
private ?string $slug = null;
public function getId(): ?int
{
return $this->id;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(string $content): static
{
$this->content = $content;
return $this;
}
public function getPublishedDate(): ?\DateTime
{
return $this->published_date;
}
public function setPublishedDate(\DateTime $published_date): static
{
$this->published_date = $published_date;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): static
{
$this->slug = $slug;
return $this;
}
}