final class ValidatorsCommands (View source)

Constants

VALIDATE_ENTITY_LOAD

Methods

validateEntityLoad(CommandData $commandData)

Validate that passed entity names are valid.

void
validateModuleEnabled(Input $input, AnnotationData $annotationData)

Validate that passed module names are enabled. We use post-init phase because interact() methods run early and they need to know that their module is enabled (e.g. image-flush).

validateFileExists(CommandData $commandData)

Validate that the file path exists.

validatePHPExtension(CommandData $commandData)

Validate that required PHP extension exists.

validatePermissions(CommandData $commandData)

Validate that the permission exists.

Details

validateEntityLoad(CommandData $commandData)

Validate that passed entity names are valid.

Parameters

CommandData $commandData

See also

ViewsCommands::execute for an example.

void validateModuleEnabled(Input $input, AnnotationData $annotationData)

Validate that passed module names are enabled. We use post-init phase because interact() methods run early and they need to know that their module is enabled (e.g. image-flush).

Parameters

Input $input
AnnotationData $annotationData

Return Value

void

See also

WatchdogCommands::show for an example.

validateFileExists(CommandData $commandData)

Validate that the file path exists.

Annotation value should be the name of the argument containing the path.

Parameters

CommandData $commandData

validatePHPExtension(CommandData $commandData)

Validate that required PHP extension exists.

Annotation value should be extension name. If multiple, delimit by a comma.

Parameters

CommandData $commandData

validatePermissions(CommandData $commandData)

Validate that the permission exists.

Annotation value should be the name of the argument/option containing the permission(s).

Parameters

CommandData $commandData