.

DelegateCommandImpl Class Reference
[Behaviour]

Implementation of Delegate command. More...

Inheritance diagram for DelegateCommandImpl:
CommandDelegate ICommand IAction ISerializable

List of all members.

Public Member Functions

  __construct ($op, $obj, $params)

Protected Member Functions

  get_obj_name ($obj)

Detailed Description

Implementation of Delegate command.

Author:
Gerd Riesselmann
Deprecated:

Definition at line 9 of file delegate.impl.cmd.php.


Constructor & Destructor Documentation

DelegateCommandImpl::__construct ( op,
obj,
params  
)

Definition at line 10 of file delegate.impl.cmd.php.

00010                                                         {
00011                 $delegate = null;
00012                 
00013                 $delegate_directory = dirname(dirname(__FILE__));
00014                 $obj_name = $this->get_obj_name($obj);
00015                 $file_name = implode('.', array($op, $obj_name, 'cmd.php'));
00016                 $file_path = implode('/', array($delegate_directory, $obj_name, $file_name));
00017                 if (file_exists($file_path)) {
00018                         require_once($file_path);
00019                         $func = 'create_' . $op  . $obj_name . '_command';
00020                         if (function_exists($func)) {
00021                                 $delegate = $func($params, $obj);
00022                         } 
00023                 }
00024                 
00025                 parent::__construct($delegate);
00026         }               

Member Function Documentation

DelegateCommandImpl::get_obj_name ( obj  )  [protected]

Definition at line 28 of file delegate.impl.cmd.php.

00028                                               {
00029                 $ret = false;
00030                 if (is_object($obj)) {
00031                         if (method_exists($obj, 'tableName')) {
00032                                 $ret = $obj->tableName();
00033                         }
00034                         else {
00035                                 $ret = get_class($obj);
00036                         }
00037                 }
00038                 else {
00039                         $ret = basename((string)$obj);
00040                 }
00041                 return $ret;
00042         }

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