I thought this was an easy task, yet there does not seem to be a Drupal-method for this. I came as far as knowing I have to use EntityFieldQuery
for this - because the API said conditions for user_load_multiple()
are deprecated.
So I tried this:
$query = new EntityFieldQuery;
$query
->entityCondition('entity_type', 'user')
->propertyCondition('rid',array(1,2,3);
$result = $query->execute();
Yet I got this:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'users.rid' in 'where clause': SELECT users.uid AS entity_id, :entity_type AS entity_type, NULL AS revision_id, :bundle AS bundle FROM {users} users WHERE (users.rid = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 3 [:entity_type] => user [:bundle] => user ) in EntityFieldQuery->execute()
So my first thought was, that I'd have to join with users_roles
-Table and so on, but that will lead to duplicates.
Does anyone have an idea how to do it?
->propertyCondition('rid', array(1, 2, 3))
;