function UserSingle7::info

8.0.x UserSingle7.php UserSingle7::info()
7.x UserSingle7.php UserSingle7::info()
master UserSingle7.php UserSingle7::info()

A flatter and simpler array presentation of a Drupal $user object.

Return value

array

Overrides UserSingleBase::info

File

lib/Drush/User/UserSingle7.php, line 23

Namespace

Drush\User

Class

UserSingle7

Code

function info() {
  $userinfo = (array) $this->account;
  unset($userinfo['data']);
  unset($userinfo['block']);
  unset($userinfo['form_build_id']);
  foreach (array('created', 'access', 'login') as $key) {
    $userinfo['user_' . $key] = format_date($userinfo[$key]);
  }
  $userinfo['user_status'] = $userinfo['status'] ? 'active' : 'blocked';
  return $userinfo;
}