You are here

protected function ChannelForm::getEntityTypeOptions in Entity Share 8.2

Same name and namespace in other branches
  1. 8.3 modules/entity_share_server/src/Form/ChannelForm.php \Drupal\entity_share_server\Form\ChannelForm::getEntityTypeOptions()
  2. 8 modules/entity_share_server/src/Form/ChannelForm.php \Drupal\entity_share_server\Form\ChannelForm::getEntityTypeOptions()

Helper function to get the entity type options.

Return value

array An array of options.

1 call to ChannelForm::getEntityTypeOptions()
ChannelForm::form in modules/entity_share_server/src/Form/ChannelForm.php
Gets the actual form array to be built.

File

modules/entity_share_server/src/Form/ChannelForm.php, line 745

Class

ChannelForm
Class ChannelForm.

Namespace

Drupal\entity_share_server\Form

Code

protected function getEntityTypeOptions() {
  $options = [];
  $definitions = $this->entityTypeManager
    ->getDefinitions();
  foreach ($definitions as $entity_type_id => $definition) {

    // Keep only content entity type without user.
    if ($definition
      ->getGroup() != 'content' || $entity_type_id == 'user') {
      continue;
    }
    $options[$entity_type_id] = $definition
      ->getLabel();
  }
  return $options;
}