You are here

public function PeopleDelete::getAvailableRoleType in Delete all 2.x

Same name and namespace in other branches
  1. 8 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;
}