class UserCommands extends DrushCommands (View source)

Traits

ProcessManagerAwareTrait
LoggerAwareTrait
IO
ConfigAwareTrait

Constants

REQ

OPT

EXIT_SUCCESS

EXIT_FAILURE

Methods

getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

__construct()

No description

LoggerInterface
logger()

Returns a logger object.

io()

Override Robo's IO function with our custom style.

printFile(string $file)

Print the contents of a file.

RowsOfFields
information($names = '', $options = ['format' => 'table', 'uid' => self::REQ, 'mail' => self::REQ])

Print information about the specified user(s).

renderRolesCell($key, $cellData, FormatterOptions $options)

No description

block(string $names)

Block the specified user(s).

unblock(string $names)

UnBlock the specified user(s).

addRole(string $role, string $names)

Add a role to the specified user accounts.

removeRole(string $role, string $names)

Remove a role from the specified user accounts.

create($name, $options = ['password' => self::REQ, 'mail' => self::REQ])

Create a user account.

createValidate(CommandData $commandData)

Assure that provided username is available.

cancel($names, $options = ['delete-content' => false])

Cancel user account(s) with the specified name(s).

password(string $name, string $password)

Set the password for the user account with the specified name.

array
infoArray($account)

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

Details

DrushConfig getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

__construct()

protected LoggerInterface logger()

Returns a logger object.

Return Value

LoggerInterface

protected io()

Override Robo's IO function with our custom style.

protected printFile(string $file)

Print the contents of a file.

Parameters

string $file Full path to a file.

RowsOfFields information($names = '', $options = ['format' => 'table', 'uid' => self::REQ, 'mail' => self::REQ])

Print information about the specified user(s).

Parameters

$names
$options

Return Value

RowsOfFields

renderRolesCell($key, $cellData, FormatterOptions $options)

Parameters

$key
$cellData
FormatterOptions $options

block(string $names)

Block the specified user(s).

Parameters

string $names A comma delimited list of user names.

unblock(string $names)

UnBlock the specified user(s).

Parameters

string $names A comma delimited list of user names.

addRole(string $role, string $names)

Add a role to the specified user accounts.

Parameters

string $role The name of the role to add.
string $names A comma delimited list of user names.

removeRole(string $role, string $names)

Remove a role from the specified user accounts.

Parameters

string $role The name of the role to add
string $names A comma delimited list of user names.

create($name, $options = ['password' => self::REQ, 'mail' => self::REQ])

Create a user account.

Parameters

$name
$options

createValidate(CommandData $commandData)

Assure that provided username is available.

Parameters

CommandData $commandData

cancel($names, $options = ['delete-content' => false])

Cancel user account(s) with the specified name(s).

Parameters

$names
$options

password(string $name, string $password)

Set the password for the user account with the specified name.

Parameters

string $name The name of the account to modify.
string $password The new password for the account.

array infoArray($account)

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

Parameters

$account A user account

Return Value

array