You are here

private function EntityConfigSettingsForm::buildEntitiesForm in Acquia Content Hub 8

Build entities form.

Return value

array Entities form.

1 call to EntityConfigSettingsForm::buildEntitiesForm()
EntityConfigSettingsForm::buildForm in src/Form/EntityConfigSettingsForm.php
Form constructor.

File

src/Form/EntityConfigSettingsForm.php, line 140

Class

EntityConfigSettingsForm
Defines the form to configure the entity types and bundles to be exported.

Namespace

Drupal\acquia_contenthub\Form

Code

private function buildEntitiesForm() {
  $form = [
    '#type' => 'fieldgroup',
    '#title' => $this
      ->t('Entities'),
    '#tree' => TRUE,
  ];
  $entity_types = $this->entityManager
    ->getAllowedEntityTypes();
  foreach ($entity_types as $type => $bundle) {
    $form[$type] = [
      '#title' => $type,
      '#type' => 'details',
      '#tree' => TRUE,
      '#description' => $this
        ->t('Select the content types that you would like to publish to Content Hub.'),
      '#open' => TRUE,
    ];
    $form[$type] += $this
      ->buildEntitiesBundleForm($type, $bundle);
  }
  return $form;
}