UpdateCommand Class Reference
[Behaviour]
Generic update command. More...
Inheritance diagram for UpdateCommand:
Public Member Functions |
|
get_description () | |
Returns a description of this command.
|
|
get_name () | |
Returns title of command. |
|
Protected Member Functions |
|
do_execute () | |
Executes commands. |
Detailed Description
Generic update command.
Definition at line 8 of file update.cmd.php.
Member Function Documentation
UpdateCommand::do_execute | ( | ) | [protected] |
Executes commands.
- Returns:
- Status
Reimplemented from CommandTransactional.
Definition at line 14 of file update.cmd.php.
00014 { 00015 $ret = new Status(); 00016 00017 /* @var $inst DataObjectBase */ 00018 $inst = $this->get_instance(); 00019 $params = $this->get_params(); 00020 // Unset primary keys on params, so e.g. ID cannot be changed by an update 00021 foreach($inst->get_table_keys() as $col => $field) { 00022 unset($params[$col]); 00023 } 00024 00025 $inst->read_from_array($this->get_params()); 00026 $ret->merge($inst->validate()); 00027 if ($ret->is_ok()) { 00028 $ret->merge($inst->update()); 00029 $this->set_result($inst); 00030 } 00031 return $ret; 00032 }
UpdateCommand::get_description | ( | ) |
Returns a description of this command.
Reimplemented from CommandBase.
Definition at line 44 of file update.cmd.php.
00044 { 00045 $ret = ''; 00046 $ret = tr( 00047 'Update instance', 00048 'app' 00049 ); 00050 return $ret; 00051 }
UpdateCommand::get_name | ( | ) |
Returns title of command.
Reimplemented from CommandBase.
Definition at line 37 of file update.cmd.php.
The documentation for this class was generated from the following file:
- gyro/core/behaviour/commands/generics/update.cmd.php