/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/Tui/Event/MultiSelectEvent.php
59 строк
1 KB
HypeMC
[Tui] Add `multiselect` option to `SelectListWidget`
07 авг 2026, 17:23
07 авг 2026, 17:23
1d28753
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Tui\Event; use Symfony\Component\Tui\Widget\SelectListWidget; /** * Event dispatched when items are selected in a multi-select SelectList. * * @experimental * * @author Fabien Potencier <fabien@symfony.com> */ class MultiSelectEvent extends AbstractEvent { /** * @param list<array{value: string, label: string, description?: string, checked?: bool}> $items */ public function __construct( SelectListWidget $target, private readonly array $items, ) { parent::__construct($target); } /** * Get the full selected item arrays. * * @return list<array{value: string, label: string, description?: string, checked?: bool}> */ public function getItems(): array { return $this->items; } /** * Get the selected item values. * * @return list<string> */ public function getValues(): array { return array_column($this->items, 'value'); } public function isEmpty(): bool { return !$this->items; } }