You are here

protected function LingotekManagementFormBase::getAllGroups in Lingotek Translation 3.5.x

Same name and namespace in other branches
  1. 8.2 src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getAllGroups()
  2. 4.0.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getAllGroups()
  3. 3.0.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getAllGroups()
  4. 3.1.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getAllGroups()
  5. 3.2.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getAllGroups()
  6. 3.3.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getAllGroups()
  7. 3.4.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getAllGroups()
  8. 3.6.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getAllGroups()
  9. 3.7.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getAllGroups()
  10. 3.8.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getAllGroups()

Gets all the groups as options.

Return value

array The groups as a valid options array.

1 call to LingotekManagementFormBase::getAllGroups()
LingotekManagementForm::getFilters in src/Form/LingotekManagementForm.php
Gets the filters for rendering.

File

src/Form/LingotekManagementFormBase.php, line 1636

Class

LingotekManagementFormBase
Form for bulk management of content.

Namespace

Drupal\lingotek\Form

Code

protected function getAllGroups() {
  $options = [];
  if ($this->entityTypeId === 'node') {

    /** @var GroupInterface[] $groups */
    $groups = $this->entityTypeManager
      ->getStorage('group')
      ->loadMultiple();
    foreach ($groups as $id => $group) {
      $options[$id] = $group
        ->label();
    }
  }
  return $options;
}