.

DeleteCommand Class Reference
[Behaviour]

Delete command. More...

Inheritance diagram for DeleteCommand:
CommandTransactional CommandBase ICommand IAction ISerializable

List of all members.

Public Member Functions

  get_description ()
  Returns a description of this command.
  get_name ()
  Returns title of command.

Protected Member Functions

  clear_history (IActionSource $deleted_instance)
  Clear history.
  do_execute ()
  Executes commands.

Detailed Description

Delete command.

Author:
Gerd Riesselmann

Definition at line 8 of file delete.cmd.php.


Member Function Documentation

DeleteCommand::clear_history ( IActionSource deleted_instance  )  [protected]

Clear history.

Parameters:
IActionSource  $deleted_instance

Definition at line 35 of file delete.cmd.php.

00035                                                                           {
00036                 $actions = $deleted_instance->get_actions(AccessControl::get_current_aro(), '');
00037                 foreach($actions as $action) {
00038                         if ($action instanceof IAction) {
00039                                 /* @var $action IAction */
00040                                 $url = ActionMapper::get_url($action->get_name(), $deleted_instance);
00041                                 History::remove($url);
00042                         }
00043                 }               
00044         }
DeleteCommand::do_execute (  )  [protected]

Executes commands.

Returns:
Status

Reimplemented from CommandTransactional.

Definition at line 14 of file delete.cmd.php.

00014                                         {
00015                 $ret = new Status();
00016                 $o = $this->get_instance();             
00017                 if ($o) {
00018                         $ret->merge($o->delete());
00019                         $this->set_result($o);
00020                         if ($ret->is_ok()) {
00021                                 $this->clear_history($o);
00022                         }
00023                 }
00024                 else {
00025                         $ret->append(tr('Delete Command: No instance set to delete', 'core'));
00026                 }
00027                 return $ret;
00028         }
DeleteCommand::get_description (  ) 

Returns a description of this command.

Reimplemented from CommandBase.

Definition at line 56 of file delete.cmd.php.

00056                                           {
00057                 $ret = '';
00058                 $inst = $this->get_instance();
00059                 if ($inst) {
00060                         $ret = tr(
00061                                 'Delete',
00062                                 'app'
00063                         );
00064                 }
00065                 return $ret;
00066         }
DeleteCommand::get_name (  ) 

Returns title of command.

Reimplemented from CommandBase.

Definition at line 49 of file delete.cmd.php.

00049                                    {
00050                 return 'delete';
00051         }

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