You are here

protected function ModuleNameForm::getFormComponentProperties in Module Builder 8.3

Gets the names of properties this form should show.

Return value

string[] An array of property names.

Overrides ComponentSectionForm::getFormComponentProperties

File

src/Form/ModuleNameForm.php, line 20

Class

ModuleNameForm
Form for editing basic information, and also for adding new module entities.

Namespace

Drupal\module_builder\Form

Code

protected function getFormComponentProperties(DataItem $data) {

  // Get the list of component properties this section form uses from the
  // handler, which gets them from the entity type annotation.
  $component_entity_type_id = $this->entity
    ->getEntityTypeId();
  $component_sections_handler = $this->entityTypeManager
    ->getHandler($component_entity_type_id, 'component_sections');

  // Need to override this method to hardcode the form operation name, because
  // there is a mismatch between our system which wants this to be the 'name'
  // op, but uses the 'edit' op's route and form class.
  // TODO: clean up!
  $operation = 'name';
  $component_properties_to_use = $component_sections_handler
    ->getSectionFormComponentProperties($operation);
  return $component_properties_to_use;
}