Class WFDecorator

Description

The main ObjectController from the Controller Layer.

WFDecorator objects are used to transparently wrap objects managed by the ControllerLayer while allowing you to implement UI-specific object formatters without having to place these functions in the core model object. WFDecorator objects are often defined in the UI Controller classes directly since the UI logic contained in them is often customized for just that UI view.

However of course you could create a decorator to be shared across many UI objects.

In Cocoa something like this would probably be done by making a Category for your model object.

Located in /framework/WFDecorator.php (line 24)

WFObject
   |
   --WFDecorator
Direct descendents
Class Description
MyTestObjectDecorator The main ObjectController from the Controller Layer.
MyOtherTestObjectDecorator The main ObjectController from the Controller Layer.
Variable Summary
object The $decoratedObject
Method Summary
WFDecorator __construct ( $decoratedObject)
void decoratedObject ()
void setValueForKey ( $v,  $k)
mixed valueForKey (string $k)
mixed __call (string $name, array $args)
Variables
object The $decoratedObject (line 29)
  • var: object being decorated by this decorator instance.
  • access: protected
Methods
Constructor __construct (line 31)
WFDecorator __construct ( $decoratedObject)
  • $decoratedObject

Redefinition of:
WFObject::__construct()
decoratedObject (line 42)

Get the underlying decorated object.

return object

void decoratedObject ()
setValueForKey (line 62)
void setValueForKey ( $v,  $k)
  • $v
  • $k

Redefinition of:
WFObject::setValueForKey()
valueForKey (line 54)

Local implementation of valueForKey() that looks for the local version in the decorator, and if that fails, passes the request through to the underlying object.

  • throws: object Exception
mixed valueForKey (string $k)
  • string $k: Key requested.

Redefinition of:
WFObject::valueForKey()
__call (line 78)

Capture function calls and pass try to handle them locally, then pass-through. Basically same idea as valueForKey()

mixed __call (string $name, array $args)
  • string $name: The method called.
  • array $args: The arguments.

Inherited Methods

Inherited From WFObject

WFObject::__construct()
WFObject::exposedProperties()
WFObject::getClass()
WFObject::keyPathToTargetAndKey()
WFObject::setValueForKey()
WFObject::setValueForKeyPath()
WFObject::setValuesForKeys()
WFObject::validatedSetValueForKey()
WFObject::validatedSetValueForKeyPath()
WFObject::validateObject()
WFObject::validateValueForKey()
WFObject::validateValueForKeyPath()
WFObject::valueForKey()
WFObject::valueForKeyPath()
WFObject::valueForStaticKey()
WFObject::valueForStaticKeyPath()
WFObject::valueForTargetAndKeyPath()
WFObject::valueForUndefinedKey()
WFObject::valueForUndefinedStaticKey()
WFObject::valuesForKeyPaths()
WFObject::valuesForKeys()
WFObject::_valueForStaticKey()
WFObject::__toString()

Documentation generated on Thu, 14 May 2009 16:19:52 -0400 by phpDocumentor 1.4.2