AddInput(self::INPUT_CLASS_NAME, ClassIOFormat::class); } /** @inheritdoc */ public function InitOutputs(): void { parent::InitOutputs(); $this->AddOutput(self::OUTPUT_ATTRIBUTE, AttributeIOFormat::class, new StringToAttributeConverter()); } /** @inheritdoc * @throws FormBlockException */ public function AllowAdd(): bool { return $this->GetInput(self::INPUT_CLASS_NAME)->Value() != ''; } /** @inheritdoc * @throws FormBlockException * @throws CoreException */ public function UpdateOptions(): array { $aOptions = parent::GetOptions(); $oValue = $this->GetInput(self::INPUT_CLASS_NAME)->Value(); if($oValue == '') return $aOptions; $aAttributeCodes = MetaModel::GetAttributesList($oValue); $aAttributeCodes = array_combine($aAttributeCodes, $aAttributeCodes) ; $aOptions['choices'] = $aAttributeCodes; return $aOptions; } }