-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix user roles #101
Fix user roles #101
Conversation
d067d7b
to
94fce30
Compare
|
||
function user_role_load(string $rid): ?RoleInterface | ||
{ | ||
return Role::load($rid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use long-form \Drupal::entityTypeManager()->getStorage('user_role')->load($rid);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could. I actually like the simplicity of letting this static method do it for us. Every entity class has a static load method.
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21EntityInterface.php/function/EntityInterface%3A%3Aload/10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clarity I changed this to use our extended Role class.
99b9d28
to
c611e42
Compare
0fc65c9
to
379f7d9
Compare
379f7d9
to
6f41864
Compare
6f41864
to
10f002c
Compare
No description provided.