.

CommandTransactional Class Reference
[Behaviour]

The Transaction Command starts a database transaction before execution and commits on success or rollbacks on error. More...

Inheritance diagram for CommandTransactional:
CommandBase ICommand IAction ISerializable CreateCommand DeleteCommand ExecuteSqlCommand ExecuteSqlScriptCommand MassDeleteCommand SetstatusCommand UpdateCommand

List of all members.

Public Member Functions

  execute ()
  Executes commands.

Protected Member Functions

  do_execute ()
  Does executing.

Detailed Description

The Transaction Command starts a database transaction before execution and commits on success or rollbacks on error.

Overload function do_execute() to implement behaviour.

Author:
Gerd Riesselmann

Definition at line 13 of file commandtransactional.cls.php.


Member Function Documentation

CommandTransactional::do_execute (  )  [protected]

Does executing.

Returns:
Status

Reimplemented in CreateCommand, DeleteCommand, ExecuteSqlCommand, ExecuteSqlScriptCommand, MassDeleteCommand, UpdateCommand, and SetstatusCommand.

Definition at line 43 of file commandtransactional.cls.php.

00043                                         {
00044                 return new Status();
00045         } 
CommandTransactional::execute (  ) 

Executes commands.

Returns:
Status

Reimplemented from CommandBase.

Definition at line 19 of file commandtransactional.cls.php.

00019                                   {
00020                 $ret = new Status();
00021                 DB::start_trans();
00022                 try { 
00023                         $ret = $this->do_execute();
00024                 }
00025                 catch (Exception $ex) {
00026                         $ret->merge($ex);
00027                 }
00028                 if ($ret->is_ok()) {
00029                         $ret->merge(parent::execute());
00030                 }
00031                 if ($ret->is_error()) {
00032                         $this->undo();
00033                 }
00034                 DB::end_trans($ret);
00035                 return $ret;
00036         }

The documentation for this class was generated from the following file: