N°8772 - Refactor

This commit is contained in:
Eric Espie
2025-11-14 16:42:42 +01:00
parent 3085023267
commit 51ebbc4274
9 changed files with 47 additions and 45 deletions

View File

@@ -72,10 +72,6 @@ class CollectionBlock extends AbstractTypeFormBlock
$sBlockEntryOptions = $this->GetOption('block_entry_options');
$this->oPrototypeBlock = new ($sBlockEntryType)('prototype', $sBlockEntryOptions);
// $this->HandleBlockDependencies();
// $this->oBlock->SetParent($this->GetParent());
// $oBlock->DependsOn('company', 'company', AbstractFormBlock::OUTPUT_VALUE);
$oOptionsRegister->SetOption('entry_type', $this->oPrototypeBlock->GetFormType());
$oOptionsRegister->SetOption('entry_options', $this->oPrototypeBlock->GetOptions());
}

View File

@@ -9,10 +9,10 @@ namespace Combodo\iTop\Forms\Block\Base;
use Combodo\iTop\Forms\Block\AbstractFormBlock;
use Combodo\iTop\Forms\Block\AbstractTypeFormBlock;
use Combodo\iTop\Forms\Block\FormBlockException;
use Combodo\iTop\Forms\FormType\Base\FormType;
use Combodo\iTop\Forms\Register\OptionsRegister;
use Combodo\iTop\Forms\FormBuilder\DependencyMap;
use Combodo\iTop\Forms\FormsException;
use Combodo\iTop\Forms\FormType\Base\FormType;
use Combodo\iTop\Forms\Register\OptionsRegister;
use Exception;
use ReflectionClass;
use ReflectionException;
@@ -43,8 +43,8 @@ class FormBlock extends AbstractTypeFormBlock
// Build the form
$this->BuildForm();
}
catch (Exception $ex) {
throw new FormsException('Unable to construct demonstrator form.', 0, $ex);
catch (Exception $e) {
throw new FormBlockException('Unable to construct form', 0, $e);
}
}
@@ -72,6 +72,7 @@ class FormBlock extends AbstractTypeFormBlock
*
* @return $this
* @throws ReflectionException
* @throws \Combodo\iTop\Forms\Block\FormBlockException
*/
public function Add(string $sName, string $sType, array $aSymfonyOptions, array $aOptions = []): AbstractFormBlock
{