class SanitizeUserFieldsCommands extends DrushCommands implements SanitizePluginInterface (View source)

This class is a good example of how to build a sql-sanitize plugin.

Traits

ProcessManagerAwareTrait
LoggerAwareTrait
IO
ConfigAwareTrait

Constants

REQ

OPT

EXIT_SUCCESS

EXIT_FAILURE

Properties

protected $database
protected $entityManager
protected $entityTypeManager

Methods

getConfig()

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

__construct($database, $entityManager, $entityTypeManager)

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.

mixed
getDatabase()

No description

mixed
getEntityManager()

No description

sanitize($result, CommandData $commandData)

Sanitize string fields associated with the user.

String[]
messages(array $messages, InputInterface $input)

No description

options($options = ['whitelist-fields' => ''])

No description

Details

DrushConfig getConfig()

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

__construct($database, $entityManager, $entityTypeManager)

Parameters

$database
$entityManager
$entityTypeManager

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.

mixed getDatabase()

Return Value

mixed

mixed getEntityManager()

Return Value

mixed

sanitize($result, CommandData $commandData)

Sanitize string fields associated with the user.

Parameters

$result Exit code from the main operation for sql-sanitize.
CommandData $commandData Information about the current request.

String[] messages(array $messages, InputInterface $input)

Parameters

array $messages An array of messages to show during confirmation.
InputInterface $input The effective commandline input for this request.

Return Value

String[] An array of messages.

options($options = ['whitelist-fields' => ''])

Parameters

$options