oPrototypeBlock; } public function EntryDependsOnParent(string $sInputName, string $sParentInputName): AbstractFormBlock { $this->oPrototypeBlock->InputDependsOnParent($sInputName, $sParentInputName); return $this; } /** @inheritdoc */ protected function RegisterIO(IORegister $oIORegister): void { parent::RegisterIO($oIORegister); $oIORegister->AddOutput(self::OUTPUT_COUNT, IntegerIOFormat::class, false, new CollectionToCountConverter()); } /** @inheritdoc */ protected function RegisterOptions(OptionsRegister $oOptionsRegister): void { parent::RegisterOptions($oOptionsRegister); $oOptionsRegister->SetOption('block_entry_type', FormBlock::class, false); $oOptionsRegister->SetOption('block_entry_options', [], false); $oOptionsRegister->SetOption('prototype', true); $oOptionsRegister->SetOption('allow_add', true); $oOptionsRegister->SetOption('prototype_options', [ 'label' => false, ]); } /** @inheritdoc */ protected function AfterOptionsRegistered(OptionsRegister $oOptionsRegister): void { parent::AfterOptionsRegistered($oOptionsRegister); $oBlockEntryType = $this->GetOption('block_entry_type'); $oBlockEntryOptions = $this->GetOption('block_entry_options'); $this->oPrototypeBlock = new $oBlockEntryType('prototype', array_merge($this->GetOption('prototype_options'), $oBlockEntryOptions)); $this->oPrototypeBlock->SetParent($this); try { $oOptionsRegister->SetOption('entry_type', $this->oPrototypeBlock->GetFormType()); $oOptionsRegister->SetOption('entry_options', $this->oPrototypeBlock->GetOptions()); } catch (RegisterException $e) { } } }