.

SetstatusCommand Class Reference
[Status]

Command to set status. More...

Inheritance diagram for SetstatusCommand:
CommandTransactional CommandBase ICommand IAction ISerializable

List of all members.

Public Member Functions

  do_execute ()
  Does executing.

Detailed Description

Command to set status.

Expects new status as $param

This command sets status on given IStatusHolder instance and updates afterwards

Author:
Gerd Riesselmann

Definition at line 11 of file setstatus.cmd.php.


Member Function Documentation

SetstatusCommand::do_execute (  ) 

Does executing.

Returns:
Status

Reimplemented from CommandTransactional.

Definition at line 17 of file setstatus.cmd.php.

00017                                      {
00018                 $ret = new Status();
00019                 $inst = $this->get_instance();
00020                 $new_status = $this->get_params();
00021                 if ($inst instanceof IStatusHolder) {
00022                         if ($inst->get_status() != $new_status) {
00023                                 $inst->set_status($new_status);
00024                                 if ($inst instanceof DataObjectBase) {
00025                                         $ret->merge($inst->update());
00026                                 }
00027                         }
00028                 }
00029                 else {
00030                         $ret->merge($this->illegal_data_error());
00031                 }
00032                 return $ret; 
00033         }

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