public function AccessStorage::getSubmittedRolesGrantedAccess in Permissions by Term 8
Same name and namespace in other branches
- 8.2 src/Service/AccessStorage.php \Drupal\permissions_by_term\Service\AccessStorage::getSubmittedRolesGrantedAccess()
Gets submitted roles with granted access from form.
Return value
array An array with chosen roles.
1 call to AccessStorage::getSubmittedRolesGrantedAccess()
- AccessStorage::saveTermPermissions in src/
Service/ AccessStorage.php - *
File
- src/
Service/ AccessStorage.php, line 82
Class
- AccessStorage
- Class AccessStorage.
Namespace
Drupal\permissions_by_term\ServiceCode
public function getSubmittedRolesGrantedAccess(FormStateInterface $form_state) {
$aRoles = $form_state
->getValue('access')['role'];
$aChosenRoles = [];
foreach ($aRoles as $sRole) {
if ($sRole !== 0) {
$aChosenRoles[] = $sRole;
}
}
return $aChosenRoles;
}