abstract class as parent for tbro-db commands. implements standard behavior
for insert, update, delete, list and display subcommands
Methods summary
public static
Console_CommandLine_Command
|
#
CLI_getCommand( Console_CommandLine $parser )
adds a command representing this class to $parser
adds a command representing this class to $parser
Parameters
- $parser
Console_CommandLine $parser
Returns
Console_CommandLine_Command
Implementation of
|
public static
nothing
|
#
CLI_checkRequiredOpts( Console_CommandLine_Result $command )
check if all required options have been set by the user
check if all required options have been set by the user
Parameters
- $command
Console_CommandLine_Result $command
Returns
nothing
Throws
Implementation of
|
public static
false
|
#
CLI_execute( Console_CommandLine_Result $command, Console_CommandLine $parser )
execute this command
Parameters
- $command
Console_CommandLine_Result $command the command as created by self::CLI_getCommand
- $parser
Console_CommandLine $parser
Returns
false if subcommand is unknown
Implementation of
|
public static
type
|
#
prepareQueryResult( type $res )
prepare a propel result for displaying with printTable
prepare a propel result for displaying with printTable
Parameters
- $res
type $res PropelObjectCollection|Array[propel\BaseObject]
Returns
type Array[Array[String]]
|
public static
|
#
printTable( Array[String] $headers, Array[Array[String]] $data )
print a table
Parameters
- $headers
Array[String] $headers
- $data
Array[Array[String]] $data
|
protected static
|
#
command_insert_set_defaults( BaseObject $item )
can be overwritten. is called after filling Propel item, before calling
$item->save can be used to satisfy non-null-constraints by setting default
values
can be overwritten. is called after filling Propel item, before calling
$item->save can be used to satisfy non-null-constraints by setting default
values
Parameters
|
protected static
|
#
setKeys( Array $options, String $keys, BaseObject $cmdname, BaseObject $propelitem )
parsing $keys for paramters, set values from $options in $propelitem.
- @param Array $options user-specified command line parameters
parsing $keys for paramters, set values from $options in $propelitem.
- @param Array $options user-specified command line parameters
Parameters
- $options
Array $keys result from self::getKeys()
- $keys
String $cmdname command name to scan keys for
- $cmdname
BaseObject $propelitem propel item to set values
- $propelitem
|
protected static
|
#
command_insert( Array $options, Array $keys )
default insert row command
default insert row command
Parameters
- $options
Array $options user-specified command line parameters
- $keys
Array $keys result from self::getKeys()
|
protected static
|
#
command_update( Array $options, Array $keys )
default update row command
default update row command
Parameters
- $options
Array $options user-specified command line parameters
- $keys
Array $keys result from self::getKeys()
|
public static
boolean
|
#
command_delete_confirm( Array $options, type $message = "This will delete a row from the database.\n" )
prompts the user to confirm deletion of a row if $option['noconfirm'] is not
set
prompts the user to confirm deletion of a row if $option['noconfirm'] is not
set
Parameters
- $options
Array $options user-specified command line parameters
- $message
type $message message to promt the user
Returns
boolean delete or not
|
protected static
|
#
command_delete( Array $options, Array $keys )
default delete row command
default delete row command
Parameters
- $options
Array $options user-specified command line parameters
- $keys
Array $keys result from self::getKeys()
|
protected static
|
#
command_details( Array $options, Array $keys )
default show details for row command
default show details for row command
Parameters
- $options
Array $options user-specified command line parameters
- $keys
Array $keys result from self::getKeys()
|
protected static
|
#
command_list( Array $options, Array $keys )
default list rows command
default list rows command
Parameters
- $options
Array $options user-specified command line parameters
- $keys
Array $keys result from self::getKeys()
|