Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: ../phpdbedittk/gadmcommand.php
PHPDBEditTk -

gadm_command

gadm_command

gadm_command

 

private class gadm_command

gadm_command
contains classes that handle high level commands which are attachedto the genericadmin class. Commands are classes where functionalitydelegated to from generic_admin. At the moment there are these commandtypes inplemented or in planning:
'row' : performs actions on a complete table row. All other commandsrun on a single field
'conversion' : converts values between multiple presentations in the databaseand the web site. An example would be to store a timestamp asa UTC timestamp, but on the web site as a local time. Notimplemented yet.
'intertable' : Handles table relations.
'intratable' : Handles calculated fields.
'intrafield' : Handles the range of values allowed for this field.
'enum' : Handles fields that contain enumerations

 
Direct known subclasses: gadm_date_command, gadm_enumeration_command, gadm_intertable_command, gadm_row_command

Public Method Summary

mixed

construct(string $comtype, string $optable, string $fieldname, object genericadmin &$sender)

actual constructor function, see comments!
mixed

execute(string $func_name, mixed $value)

executes the command
mixed

checkinput(string $func_name, mixed $val)

executes the command

Private Method Summary

void

_save_constructor_params(string $optable, string $fieldname, object genericadmin &$sender)

save the parameters of the constructor in the class variables.
void

checkfilterinput( $func_name, $val)

Warning: documentation is missing.

Private Field Summary

array

$command_types

Contains possible command type and the classes,which represent them
string

$optable

Table, on which the command operates.
string

$fieldname

Fieldname, the command operates on, if applicable.
object genericadmin

$sender

Sender of the command invocation.

Public Method Details

construct

public mixed construct( string $comtype, string $optable, string $fieldname, object genericadmin &$sender )

  actual constructor function, see comments!
additional constructor function because php doesn't allow to return asubclass from the constructor.
The top-class of gadmcommand acts like the factory method/ strategypattern, together with the command_factory class: It reads the typeof command which should be constructed and initialises theappropriate class. As you can't control the return class of theconstructor yet, there has to be an additional constructor function.

Parameter
string $comtype
type of the command
string $optable
table the command is attached to
string $fieldname
fieldname the command is attached to
object genericadmin &$sender
reference of the initiator if the command
Returns mixed

the appropriate command object for this type, or the generic command class, if type is "dummy"


execute

public mixed execute( string $func_name, mixed $value )

  executes the command
As this is the top level command class, it will just call thefunction name specified. Each function represents a more lowlevel functionality and therefore ignores a command type

Parameter
string $func_name
name of the function to call
mixed $value
value to handle
Returns mixed

result of the function call, depending on the function


checkinput

public mixed checkinput( string $func_name, mixed $val )

  executes the command
As this is the top level command class, it will just call thefunction name specified. Each function represents a more lowlevel functionality and therefore ignores a command type

Parameter
string $func_name
name of the function to call
mixed $val
value to handle
Returns mixed

result of the function call, depending on the function


Private Method Details

_save_constructor_params

private void _save_constructor_params( string $optable, string $fieldname, object genericadmin &$sender )

  save the parameters of the constructor in the class variables.

Parameter
string $optable
Table, on which the command operates.
string $fieldname
Fieldname, it operates on
object genericadmin &$sender
invocator of the command
Returns void


checkfilterinput

private void checkfilterinput( $func_name, $val )

 

Warning: documentation is missing.

Parameter
$func_name
Warning: documentation is missing.
$val
Warning: documentation is missing.
Returns void


Private Field Details

$command_types

private array $command_types

>>array( "row" => "gadm_row_command", "conversion" => "gadm_conversion_command", "intertable" => "gadm_intertable_command", "intratable" => "gadm_intratable_command", "intrafield" => "gadm_intrafield_command", "datetime" => "gadm_date_command", "enum" => "gadm_enumeration_command", "other" => "gadm_other_command", "dummy" => "" )<<

Contains possible command type and the classes,which represent them
The key is used to describe the command in the db-definition array.The value represents the class name of the command.


$optable

private string $optable

>><<

Table, on which the command operates.
This is used to access information about the table from the dbdefinitions. Its a table name as specified as a key in thedbdef


$fieldname

private string $fieldname

>><<

Fieldname, the command operates on, if applicable.
This is used to access information about the field from the dbdefinitions.


$sender

private object genericadmin $sender

>><<

Sender of the command invocation.
Usually the generic_admin object. There are several propertiesin the genericadmin object which are used, eg. table, currrow,dbdef, db etc.



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta