mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 15:34:12 +01:00
36 lines
895 B
PHP
36 lines
895 B
PHP
<?php
|
|
/*
|
|
* @copyright Copyright (C) 2010-2025 Combodo SARL
|
|
* @license http://opensource.org/licenses/AGPL-3.0
|
|
*/
|
|
|
|
namespace Combodo\iTop\Forms\Block\Base;
|
|
|
|
use Combodo\iTop\Forms\Block\AbstractTypeFormBlock;
|
|
use Combodo\iTop\Forms\FormType\Base\ChoiceFormType;
|
|
use Combodo\iTop\Forms\IO\Converter\ChoiceValueToLabelConverter;
|
|
use Combodo\iTop\Forms\IO\Format\RawFormat;
|
|
use Combodo\iTop\Forms\Register\IORegister;
|
|
|
|
/**
|
|
* Form block for choices.
|
|
*
|
|
*/
|
|
class ChoiceFormBlock extends AbstractTypeFormBlock
|
|
{
|
|
// Outputs
|
|
public const OUTPUT_LABEL = 'label';
|
|
|
|
/** @inheritdoc */
|
|
public function GetFormType(): string
|
|
{
|
|
return ChoiceFormType::class;
|
|
}
|
|
|
|
/** @inheritdoc */
|
|
protected function RegisterIO(IORegister $oIORegister): void
|
|
{
|
|
parent::RegisterIO($oIORegister);
|
|
$oIORegister->AddOutput(self::OUTPUT_LABEL, RawFormat::class, new ChoiceValueToLabelConverter($this));
|
|
}
|
|
} |