.

CommandDelegate Class Reference
[Behaviour]

The command delegate delegates all request to another command. More...

Inheritance diagram for CommandDelegate:
ICommand IAction ISerializable DelegateCommandImpl StatusCommand

List of all members.

Public Member Functions

  __construct ($delegate)
  can_execute ($user)
  Returns TRUE, if the command can be executed by given user.
  execute ()
  Executes commands.
  get_description ()
  Returns a description of this command.
  get_instance ()
  Returns the object this actionworks upon.
  get_name ()
  Returns title of command.
  get_name_serialized ()
  Returns a name that has parameters build in.
  get_params ()
  Returns params.
  get_result ()
  Return result of command.
  get_success_message ()
  Returns success message for this command.
  serialize ()
  Make this command available for text processing systems (that is: the HTML code).
  undo ()
  Revert execution.

Protected Member Functions

  check_delegate ()

Protected Attributes

  $delegate

Detailed Description

The command delegate delegates all request to another command.

Use the command to wrap another

Author:
Gerd Riesselmann

Definition at line 12 of file commanddelegate.cls.php.


Constructor & Destructor Documentation

CommandDelegate::__construct ( delegate  ) 

Definition at line 20 of file commanddelegate.cls.php.

00020                                                {
00021                 $this->delegate = $delegate;
00022         }

Member Function Documentation

CommandDelegate::can_execute ( user  ) 

Returns TRUE, if the command can be executed by given user.

Implements ICommand.

Definition at line 102 of file commanddelegate.cls.php.

00102                                            {
00103                 $this->check_delegate();
00104                 return $this->delegate->can_execute($user);
00105         }
CommandDelegate::check_delegate (  )  [protected]

Definition at line 24 of file commanddelegate.cls.php.

00024                                             {
00025                 if (empty($this->delegate)) {
00026                         throw new Exception('No delegate set for delegation command ' . get_class($this));
00027                 }
00028         }
CommandDelegate::execute (  ) 

Executes commands.

Returns:
Status

Implements ICommand.

Definition at line 107 of file commanddelegate.cls.php.

00107                                   {
00108                 $this->check_delegate();
00109                 return $this->delegate->execute();
00110         }
CommandDelegate::get_description (  ) 

Returns a description of this command.

Implements IAction.

Definition at line 41 of file commanddelegate.cls.php.

00041                                           {
00042                 $this->check_delegate();
00043                 return $this->delegate->get_description();
00044         } 
CommandDelegate::get_instance (  ) 

Returns the object this actionworks upon.

Returns:
mixed

Implements IAction.

Definition at line 51 of file commanddelegate.cls.php.

00051                                        {
00052                 $this->check_delegate();
00053                 return $this->delegate->get_instance();
00054         }
CommandDelegate::get_name (  ) 

Returns title of command.

Implements IAction.

Definition at line 33 of file commanddelegate.cls.php.

00033                                    {
00034                 $this->check_delegate();
00035                 return $this->delegate->get_name();
00036         }
CommandDelegate::get_name_serialized (  ) 

Returns a name that has parameters build in.

Returns:
string

Implements ICommand.

Definition at line 89 of file commanddelegate.cls.php.

00089                                               {
00090                 $this->check_delegate();
00091                 return $this->delegate->get_name_serialized();
00092         }       
CommandDelegate::get_params (  ) 

Returns params.

Returns:
mixed

Implements ICommand.

Definition at line 61 of file commanddelegate.cls.php.

00061                                      {
00062                 $this->check_delegate();
00063                 return $this->delegate->get_params();
00064         }       
CommandDelegate::get_result (  ) 

Return result of command.

Returns:
mixed

Implements ICommand.

Definition at line 79 of file commanddelegate.cls.php.

00079                                      {
00080                 $this->check_delegate();
00081                 return $this->delegate->get_result();
00082         }               
CommandDelegate::get_success_message (  ) 

Returns success message for this command.

Implements ICommand.

Definition at line 69 of file commanddelegate.cls.php.

00069                                               {
00070                 $this->check_delegate();
00071                 return $this->delegate->get_success_message();
00072         }               
CommandDelegate::serialize (  ) 

Make this command available for text processing systems (that is: the HTML code).

Implements ISerializable.

Definition at line 97 of file commanddelegate.cls.php.

00097                                     {
00098                 $this->check_delegate();
00099                 return $this->delegate->serialize();
00100         }       
CommandDelegate::undo (  ) 

Revert execution.

Implements ICommand.

Definition at line 112 of file commanddelegate.cls.php.

00112                                {
00113                 $this->check_delegate();
00114                 $this->delegate->undo();
00115         }       

Member Data Documentation

CommandDelegate::$delegate [protected]

Definition at line 18 of file commanddelegate.cls.php.


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