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

EXIT_FAILURE_WITH_CLARITY

Properties

protected CommandData $commandData from  DrushCommands
protected $database
protected $entityFieldManager
protected $entityTypeManager

Methods

getConfig()

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

__construct($database, $entityFieldManager, $entityTypeManager)

No description

io()

Override Robo's IO function with our custom style.

LoggerInterface
logger()

Returns a logger object.

printFile(string $file)

Print the contents of a file.

preHook(CommandData $commandData)

Persist commandData for use in primary command callback. Used by 'topic' commands.

printFileTopic(CommandData $commandData)

Print the contents of a file. The path comes from the @topic annotation.

HandlerStack
getStack()

Get a Guzzle handler stack that uses the Drush logger.

mixed
getDatabase()

No description

mixed
getEntityFieldManager()

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' => '', 'allowlist-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, $entityFieldManager, $entityTypeManager)

Parameters

$database
$entityFieldManager
$entityTypeManager

protected io()

Override Robo's IO function with our custom style.

protected LoggerInterface logger()

Returns a logger object.

Return Value

LoggerInterface

protected printFile(string $file)

Print the contents of a file.

Parameters

string $file Full path to a file.

preHook(CommandData $commandData)

Persist commandData for use in primary command callback. Used by 'topic' commands.

Parameters

CommandData $commandData

protected printFileTopic(CommandData $commandData)

Print the contents of a file. The path comes from the @topic annotation.

Parameters

CommandData $commandData Full path to a file.

protected HandlerStack getStack()

Get a Guzzle handler stack that uses the Drush logger.

mixed getDatabase()

Return Value

mixed

mixed getEntityFieldManager()

Return Value

mixed

sanitize($result, CommandData $commandData)

Sanitize string fields associated with the user.

Parameters

$result 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' => '', 'allowlist-fields' => ''])

Parameters

$options