You are here

public function PeopleDelete::getAvailableRoleType in Delete all 8

Same name and namespace in other branches
  1. 2.x src/Form/PeopleDelete.php \Drupal\delete_all\Form\PeopleDelete::getAvailableRoleType()

It return the availble role type, into an associative array form.

1 call to PeopleDelete::getAvailableRoleType()
PeopleDelete::buildForm in src/Form/PeopleDelete.php
Form constructor.

File

src/Form/PeopleDelete.php, line 81

Class

PeopleDelete
Form for user deleting option.

Namespace

Drupal\delete_all\Form

Code

public function getAvailableRoleType() {
  $userTypes = $this->roleType
    ->loadMultiple();
  $userTypeList = [];
  foreach (array_slice($userTypes, 2) as $userType) {
    $userTypeList[$userType
      ->id()] = $userType
      ->label();
  }
  return $userTypeList;
}