up schema with relations between objects

This commit is contained in:
Tykayn 2025-02-14 11:08:34 +01:00 committed by tykayn
parent 1c700917b3
commit 17e7fce7f8
8 changed files with 433 additions and 11 deletions

View file

@ -16,6 +16,9 @@ class Category
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\ManyToOne(inversedBy: 'categories')]
private ?User $user = null;
public function getId(): ?int
{
return $this->id;
@ -32,4 +35,16 @@ class Category
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): static
{
$this->user = $user;
return $this;
}
}