Class WFObjectController


The main ObjectController from the Controller Layer.

  • see: WFDecorator The WFObjectController provides a controller-layer compatible container for a single object. The following are legitimate Controller Keys for this controller: selection selectedObjects isEditable UNIMPLEMENTED canAdd UNIMPLEMENTED canRemove UNIMPLEMENTED The following properties of the WFObjectController can be bound: content editable UNIMPLEMENTED
  • see: WFKeyValueBindingCreation
  • see: WFKeyValueCoding
  • todo: Upgrade to cocoa-compatible defaults automaticallyPreparesContent FALSE --> BC-breaking CHANGE; will require testing all apps that use it avoidsEmptySelection TRUE selectsInsertedObjects TRUE (not yet implemented) editable TRUE preservesSelection TRUE

Located in /framework/WFObjectController.php (line 39)

Direct descendents
Class Description
WFArrayController The ArrayController class.
Variable Summary
string $class
object The $content
array $decorators
Method Summary
WFObjectController __construct ()
void checkObjectClass (object WFObject $obj)
void content ()
void decorateObject ( $o)
void prepareContent ()
void selection ()
void setClass (string $class)
void setContent (object The $obj)
void setDecorator (string $decoratorClassName)
void setDecorators (string $decoratorList)
void undecorateObject ( $o)
boolean $automaticallyPreparesContent (line 52)
  • var: Does the controller create an instance of the controller class type if there is not one already?
  • access: protected
string $class (line 48)
  • var: The class name of the content.
  • access: protected
object The $content (line 44)
  • var: object being managed by this controller instance.
  • access: protected
array $decorators (line 56)
  • var: An array of WFDecorator objects that will be used to wrap the content object(s).
  • access: protected
Constructor __construct (line 58)
WFObjectController __construct ()

Redefinition of:

Redefined in descendants as:
checkObjectClass (line 110)

Make sure the passed object is of the type that this array controller manages.

NOTE: This check will succeed as long as the object is a instance of the class, subclass, or implements the interface, in WFArrayController::$class. NOTE: insert enforces an additional check, in that WFArrayController::$class must be a class, so that it is instantiable.

  • throws: object WFException If the passed object is not of the type managed by this ArrayController.
void checkObjectClass (object WFObject $obj)
  • object WFObject $obj: An instance of the object to check.
content (line 189)
void content ()
decorateObject (line 121)

Decorate the passed object with the decorator(s) for this controller.

  • access: protected
void decorateObject ( $o)
  • $o
prepareContent (line 142)

Prepare the controller's content.

Basically, this will make sure that an instance exists. If one doesn't, a new instance of the class will be created and used as the content.

  • access: protected
void prepareContent ()

Redefined in descendants as:
selectedObjects (line 170)

Get an array with the selected objects.

  • return: array containing the selected objects, or an empty array if there is no selection.
An selectedObjects ()

Redefined in descendants as:
selection (line 183)
void selection ()

Redefined in descendants as:
setAutomaticallyPreparesContent (line 196)
void setAutomaticallyPreparesContent ( $prepare)
  • $prepare
setClass (line 72)

Set the class name that is managed by this object controller.

void setClass (string $class)
  • string $class: Class name.
setContent (line 160)

Set the content managed by this controller instance.

If there already is a content, this will replace it.

void setContent (object The $obj)
  • object The $obj: object to manage. This must be a WFObject subclass, or potentially another object that implements Key-Value Coding.

Redefined in descendants as:
setDecorator (line 82)

Set a object WFDecorator object to be used with this controller.

void setDecorator (string $decoratorClassName)
  • string $decoratorClassName: The name of the decorator class.
setDecorators (line 92)

Set multiple object WFDecorator objects to be used with this controller.

void setDecorators (string $decoratorList)
  • string $decoratorList: The name(s) of the decorator class(es) to be used to decorate objects managed by this controller. Names should be separated by commas; LAST one wins.
undecorateObject (line 130)
  • access: protected
void undecorateObject ( $o)
  • $o

Inherited Methods

Inherited From WFObject


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