SetOption('placeholder', 'Select an attribute...'); } /** @inheritdoc */ protected function RegisterIO(IORegister $oIORegister): void { parent::RegisterIO($oIORegister); $oIORegister->AddInput(self::INPUT_CLASS_NAME, ClassIOFormat::class); $oIORegister->AddOutput(self::OUTPUT_ATTRIBUTE, AttributeIOFormat::class, new StringToAttributeConverter()); } /** @inheritdoc */ public function UpdateOptions(OptionsRegister $oOptionsRegister): void { parent::UpdateOptions($oOptionsRegister); $oClass = $this->GetInputValue(self::INPUT_CLASS_NAME); if($oClass === null){ $oOptionsRegister->SetOption('choices', []); return; } $aAttributeCodes = MetaModel::GetAttributesList($oClass); $aAttributes = []; foreach ($aAttributeCodes as $sAttributeCode){ $oAttribute = MetaModel::GetAttributeDef(strval($oClass), $sAttributeCode); $aAttributes[$oAttribute->GetLabel()] = $sAttributeCode; } $oOptionsRegister->SetOption('choices', $aAttributes); } }