src/Entity/Mapped/NamedEntity.php line 11

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Mapped;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. #[ORM\MappedSuperclass]
  7. class NamedEntity extends Entity
  8. {
  9.     #[ORM\Column(
  10.         name'name',
  11.         type'string',
  12.         length181,
  13.         nullabletrue
  14.     )]
  15.     #[Assert\NotBlank(
  16.         groups: ['action']
  17.     )]
  18.     #[Assert\Length(
  19.         max180,
  20.         groups: ['action']
  21.     )]
  22.     private ?string $name null;
  23.     public function getName(): ?string
  24.     {
  25.         return $this->name;
  26.     }
  27.     public function setName(?string $name): self
  28.     {
  29.         $this->name $name;
  30.         return $this;
  31.     }
  32. }