Class Ismo_Core_AOP_StateProxy

Description

This is a dynamic proxy class that can proxy for Ismo_Core_State_HTTP and

derivated clases. The instance it should be a proxy for is given to the constructor and then all properties that are accessed (both retrieved and set) and all methods invoked on the proxy are forwared to the "target" instance. The configured interceptors are applied before the call is forwarded to the target, and the interceptors decide if the call is passed on down the chain (of interceptors) or not.

Note that this class requires PHP version 4.3.0 or higher with the overload extension enabled (it's enabled by default)

Located in /AOP/StateProxy.php (line 41)


	
			
Variable Summary
Method Summary
Ismo_Core_AOP_StateProxy Ismo_Core_AOP_StateProxy (mixed $instance, mixed $interceptors)
void execute ()
void _actionMethodMissing (string $name)
void _recurseShow (string $res)
boolean __call (string $methodName, array $params, mixed &$returnValue)
boolean __get (string $name, mixed &$returnValue)
boolean __set (string $name, mixed $value)
Variables
mixed $_instance (line 49)

The instance of a class that this proxy is a proxy for.

  • access: private
array $_interceptors (line 57)

All of the configured interceptors.

  • access: private
Methods
Constructor Ismo_Core_AOP_StateProxy (line 68)

The constructor.

This creates a dynamic proxy for the class instance given to the constructor.

  • access: public
Ismo_Core_AOP_StateProxy Ismo_Core_AOP_StateProxy (mixed $instance, mixed $interceptors)
  • mixed $instance: the instance of a class to be a proxy for
execute (line 185)

Handles the request.

This is the method that the Ismo_Core_Application class calls. It figures out the action, checks if the request is authorized, expose the default variables and then calls the action method.

This method should never be called manually.

  • access: public
  • todo: this should not be here, fix by having dispatcher classes later on
void execute ()
_actionMethodMissing (line 259)

Missing action method saver.

This method is called whenever an action which doesn't have a corresponding exec... method is requested. This implementation just calls the execDefault (i.e. the default action) method.

Override if you want some other behaviour.

  • access: private
  • todo: this should not be here, fix by having dispatcher classes later on
void _actionMethodMissing (string $name)
  • string $name: the requested action's name
_recurseShow (line 303)

Handles showMethod calls recursively

This method takes the result value of an execute action method call. If the result is a string value that matches an appropriate show method the show method is called. In turn, each resulting return value is handled recursively to allow a 'layered' view.

  • access: private
void _recurseShow (string $res)
  • string $res: result value (if any) from the action method call
__call (line 89)

Method invoker.

This method is called when a method is called on the proxy. The proxy then invokes the method on the target.

  • return:
    1. true
    tells the parser that the operation was successful.
    1. false
    indicates the operation failed.
  • access: private
boolean __call (string $methodName, array $params, mixed &$returnValue)
  • string $methodName: the name of the method
  • array $params: the parameters given to the method
  • mixed $returnValue: this will be set to the value the method returns
__get (line 141)

Property getter.

This method is called when a property of the proxy is retrived. The proxy when gets the value from the target instance.

Note:

  1. isset($proxy->foo);
Causes an "PHP ERROR: Undefined property" error if this method returns false, so it has to always return true. However the return value is set to
  1. null
in case the property isn't set.

  • return:
    1. true
    tells the parser that the operation was successful.
    1. false
    indicates the operation failed.
  • access: private
boolean __get (string $name, mixed &$returnValue)
  • string $name: the name of the property to get the value from
  • mixed $returnValue: this will be set to the value of the property
__set (line 165)

Property setter.

This method is called when a property of the proxy is set. The proxy then sets the property of the target instance.

  • return:
    1. true
    tells the parser that the operation was successful.
    1. false
    indicates the operation failed.
  • access: private
boolean __set (string $name, mixed $value)
  • string $name: the name of the property to set
  • mixed $value: the value the property is set to

Documentation generated on Mon, 14 Jun 2004 11:59:37 +0200 by phpDocumentor 1.3.0RC3