https://g.co/gemini/share/202233b741b4


// src/Entity/Author.php
namespace App\Entity;

use Symfony\Component\Validator\Constraints as Assert;

class Author
{
    public const GENRES = ['fiction', 'non-fiction'];

    #[Assert\Choice(['New York', 'Berlin', 'Tokyo'])]
    protected string $city;

    #[Assert\Choice(choices: Author::GENRES, message: 'Choose a valid genre.')]
    protected string $genre;
}


Powered by Froala Editor