/
AleksWork
/
diary_plants
Обзор
Документация
Войти
/
AleksWork
/
diary_plants
Код
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/Domain/Model/Marker/CreateMarkerModel.php
29 строк
1 KB
AlexeySerov
Add type field to Marker entity
10 мар 2026, 17:54
10 мар 2026, 17:54
e0582e1
Код
Авторство
О чём код?
<?php namespace App\Domain\Model\Marker; use Symfony\Component\Validator\Constraints as Assert; class CreateMarkerModel { public function __construct( #[Assert\NotBlank] #[Assert\Type(type: 'integer', message: 'The value {{ value }} is not a valid integer.')] public readonly int $groupId, #[Assert\NotBlank] #[Assert\Type('string')] #[Assert\Length(min: 1, max: 3, maxMessage: 'Letter must be exactly one character long.')] public readonly string $letter, #[Assert\NotBlank] #[Assert\Type('string')] #[Assert\Length(min: 7, max: 7, maxMessage: 'Letter must be exactly seven character long. i.e. #ffffff')] public readonly string $color, #[Assert\NotBlank] #[Assert\Type('string')] #[Assert\Length(min: 1, max: 20, maxMessage: 'Type must be exactly one character long.')] public readonly string $type, public readonly ?string $description = null, public readonly ?string $colorDescription = null, ) { } }