public function testGetType() { $node = new FieldNodeDefinition(self::TEST_NAME, $this->testDefinition); $this->assertEquals(self::TEST_TYPE, $node->getType()); }
/** * @param FormBuilderInterface $form * @param FieldNodeDefinition $fieldDefinition */ protected function addFieldToForm(FormBuilderInterface $form, FieldNodeDefinition $fieldDefinition) { if ($fieldDefinition->getAclResource() && !$this->checkIsGranted($fieldDefinition->getAclResource())) { // field is not allowed to be shown, do nothing return; } $name = str_replace(ConfigManager::SECTION_MODEL_SEPARATOR, ConfigManager::SECTION_VIEW_SEPARATOR, $fieldDefinition->getName()); // take config field options form field definition $configFieldOptions = array_intersect_key($fieldDefinition->getOptions(), array_flip(['label', 'required', 'block', 'subblock', 'tooltip', 'resettable'])); // pass only options needed to "value" form type $configFieldOptions['target_field_type'] = $fieldDefinition->getType(); $configFieldOptions['target_field_options'] = array_diff_key($fieldDefinition->getOptions(), $configFieldOptions); $configFieldOptions['parent_checkbox_label'] = $this->getParentCheckboxLabel(); $form->add($name, 'oro_config_form_field_type', $configFieldOptions); }