function SiteConfigureForm::getAdminRoles

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php \Drupal\Core\Installer\Form\SiteConfigureForm::getAdminRoles()

Returns the list of admin roles.

Return value

\Drupal\user\RoleInterface[] The list of admin roles.

2 calls to SiteConfigureForm::getAdminRoles()
SiteConfigureForm::buildForm in core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php
Form constructor.
SiteConfigureForm::submitForm in core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php
Form submission handler.

File

core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php, line 363

Class

SiteConfigureForm
Provides the site configuration form.

Namespace

Drupal\Core\Installer\Form

Code

protected function getAdminRoles() : array {
    return $this->entityTypeManager
        ->getStorage('user_role')
        ->loadByProperties([
        'is_admin' => TRUE,
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.