Created
October 19, 2018 16:32
-
-
Save DanLaufer/9242b11561a0be4e64c62a3ce855ac53 to your computer and use it in GitHub Desktop.
Drupal 8 - EntityQuery to get Users with role programmatically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Find all users with the Administrator role. | |
$admin_user_ids = \Drupal::entityQuery('user') | |
->condition('roles', 'Administrator', 'CONTAINS') | |
->execute(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment