Add post and species forms
Squashed commit of the following: Author: Hugo PRADIER <Hugo.PRADIER2@etu.uca.fr> Author: bastien ollier <bastien.ollier@etu.uca.fr> Author: clfreville2 <clement.freville2@etu.uca.fr> Reviewed on #7
This commit is contained in:
@@ -11,6 +11,7 @@ use App\Repository\PostRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Attribute\Groups;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
#[ORM\Entity(repositoryClass: PostRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
@@ -30,6 +31,7 @@ class Post
|
||||
|
||||
#[ORM\Column]
|
||||
#[Groups(['post:collection:read'])]
|
||||
#[Assert\NotBlank]
|
||||
private ?\DateTimeImmutable $foundDate = null;
|
||||
|
||||
#[ORM\Column]
|
||||
@@ -51,6 +53,7 @@ class Post
|
||||
|
||||
#[ORM\Column(type: Types::TEXT)]
|
||||
#[Groups(['post:read'])]
|
||||
#[Assert\NotBlank]
|
||||
private ?string $commentary = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'posts')]
|
||||
|
@@ -9,6 +9,7 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Attribute\Groups;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
#[ORM\Entity(repositoryClass: SpeciesRepository::class)]
|
||||
#[ApiResource(
|
||||
@@ -26,14 +27,17 @@ class Species
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[Groups(['species:collection:read'])]
|
||||
#[Assert\NotBlank]
|
||||
private ?string $scientific_name = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[Groups(['species:collection:read'])]
|
||||
#[Assert\NotBlank]
|
||||
private ?string $vernacular_name = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[Groups(['species:collection:read'])]
|
||||
#[Assert\NotBlank]
|
||||
private ?string $region = null;
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user