public function UserList::each

8.0.x UserList.php public UserList::each($method, array $params = array())
7.x UserList.php public UserList::each($method, array $params = array())
master UserList.php public UserList::each($method, array $params = array())

Iterate over each account and call the specified method.

Parameters

$method: A method on a UserSingleBase object.

array $params: An array of params to pass to the method.

Return value

array An associate array of values keyed by account ID.

File

lib/Drush/User/UserList.php, line 33

Namespace

Drush\User

Class

UserList

Code

public function each($method, array $params = array()) {
  foreach ($this->accounts as $account) {
    $return[$account->id()] = call_user_func_array(array($account, $method), $params);
  }
  return $return;
}