QuerygenCommand

Type
Class
Namespace
Craft
Inherits
Craft\QuerygenCommand » Craft\BaseCommand » CConsoleCommand » CComponent
Since
1.0

The query generator console command.

See also http://craftcms.com

View source

Public Properties

PropertyDescription
$defaultActionstring

$defaultAction

Signature

public string $defaultAction = 'all'

Public Methods

MethodDescription
__call()Calls the named method which is not a class method.
__construct()Constructor.
__get()Returns a property value, an event handler list or a behavior based on its name.
__isset()Checks if a property value is null.
__set()Sets value of a component property.
__unset()Sets a component property to be null.
actionAddForeignKeysForRecord()Returns the PHP code to add foreign keys to a table for a given record.
actionAll()
actionCreateTableForRecord()Returns the PHP code to create a new table from a given record.
asa()Returns the named behavior object.
attachBehavior()Attaches a behavior to this component.
attachBehaviors()Attaches a list of behaviors to the component.
attachEventHandler()Attaches an event handler to an event.
behaviors()Returns a list of behaviors that this command should behave as.
buildFileList()Builds the file list of a directory.
canGetProperty()Determines whether a property can be read.
canSetProperty()Determines whether a property can be set.
confirm()Asks user to confirm by typing y or n.
copyFiles()Copies a list of files from one place to another.
detachBehavior()Detaches a behavior from the component.
detachBehaviors()Detaches all behaviors from the component.
detachEventHandler()Detaches an existing event handler.
disableBehavior()Disables an attached behavior.
disableBehaviors()Disables all behaviors attached to this component.
enableBehavior()Enables an attached behavior.
enableBehaviors()Enables all behaviors attached to this component.
ensureDirectory()Creates all parent directories if they do not exist.
evaluateExpression()Evaluates a PHP expression or callback under the context of this component.
getCommandRunner()
getEventHandlers()Returns the list of attached event handlers for an event.
getHelp()Provides the command description.
getName()
getOptionHelp()Provides the command option help information.
hasEvent()Determines whether an event is defined.
hasEventHandler()Checks whether the named event has attached handlers.
hasProperty()Determines whether a property is defined.
init()Initializes the command object.
onAfterAction()This event is raised after an action finishes execution.
onBeforeAction()This event is raised before an action is to be executed.
pluralize()Converts a word to its plural form.
prompt()Reads input via the readline PHP extension if that's available, or fgets() if readline is not installed.
raiseEvent()Raises an event.
renderFile()Renders a view file.
run()Executes the command.
usageError()Displays a usage error.

actionAddForeignKeysForRecord()

Returns the PHP code to add foreign keys to a table for a given record.

View source

Arguments

  • $args

Returns

integer

Signature

public integer actionAddForeignKeysForRecord ( $args )

actionAll()

View source

Arguments

  • $args

Signature

public void actionAll ( $args )

actionCreateTableForRecord()

Returns the PHP code to create a new table from a given record.

View source

Arguments

  • $args

Returns

integer

Signature

public integer actionCreateTableForRecord ( $args )

Protected Methods

MethodDescription
afterAction()This method is invoked right after an action finishes execution.
beforeAction()This method is invoked right before an action is to be executed.
resolveRequest()Parses the command line arguments and determines which action to perform.