public function UserSingleBase::info

8.0.x UserSingleBase.php public UserSingleBase::info()
7.x UserSingleBase.php public UserSingleBase::info()
master UserSingleBase.php public UserSingleBase::info()

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

Return value

array

1 method overrides UserSingleBase::info()
UserSingle7::info in lib/Drush/User/UserSingle7.php
A flatter and simpler array presentation of a Drupal $user object.

File

lib/Drush/User/UserSingleBase.php, line 19

Namespace

Drush\User

Class

UserSingleBase

Code

public function info() {
  return array(
    'uid' => $this->account->id(),
    'name' => $this->account->getUsername(),
    'password' => $this->account->getPassword(),
    'mail' => $this->account->getEmail(),
    'user_created' => $this->account->getCreatedTime(),
    'created' => format_date($this->account->getCreatedTime()),
    'user_access' => $this->account->getLastAccessedTime(),
    'access' => format_date($this->account->getLastAccessedTime()),
    'user_login' => $this->account->getLastLoginTime(),
    'login' => format_date($this->account->getLastLoginTime()),
    'user_status' => $this->account->get('status')->value,
    'status' => $this->account->isActive() ? 'active' : 'blocked',
    'timezone' => $this->account->getTimeZone(),
    'roles' => $this->account->getRoles(),
    'langcode' => $this->account->getPreferredLangcode(),
    'uuid' => $this->account->uuid->value,
  );
}