Class WFObject

Description

Implements interfaces:

Base Class for all framework classes.

Provides:

  • KeyValueCoding

Located in /framework/WFObject.php (line 16)


	
			
Direct descendents
Class Description
WFFixture YAML Fixtures Data loader utility.
WFModelBuilderPropel Base Class for all framework classes.
WFModel Base Class for all framework classes.
WFModelEntity Base Class for all framework classes.
WFModelEntityProperty Base Class for all framework classes.
WFModelEntityRelationship Base Class for all framework classes.
WFModelCodeGenPropel Base Class for all framework classes.
Node Base Class for all framework classes.
ObjectHolder Base Class for all framework classes.
Person Base Class for all framework classes.
PersonID Base Class for all framework classes.
StaticPerson Base Class for all framework classes.
ObjectWithPrimitivesOnly Base Class for all framework classes.
WFShell The phocoa shell is an interactive PHP shell for working with your phocoa applications.
WFKeyValueValidators Built-in Key-Value Validators.
WFValueTransformer WFValueTransformer
WFArray A KVC-compliant array wrapper.
WFAuthorizationDelegate Informal delegate protocol for your web application to handle authentication.
WFAuthorizationInfo The WFAuthorizationInfo object stores all access control information for the logged-in user.
WFAuthorizationManager The WFAuthorizationManager helps the application manage user authentication, login, and access control.
WFBindingSetup The WFBindingSetup object contains all of the static information about available bindings for a class.
WFBinding The binding object.
WFDecorator The main ObjectController from the Controller Layer.
WFDieselSearch This class provides a PHP-front end to the basic Dieselpoint search capabilities.
WFDieselHit The WFDieselHit object represents a result row from a WFDieselSearch.
WFDieselHitDataObject A generic wrapper class to provide KVC-compliance to rows returned from WFDieselSearch.
WFDieselSearchHelper High-level class to help manage complex faceted navigation searches.
WFError A generic error class.
WFExceptionReporting The WFExceptionReporting class provides some static helper methods for dealing with exceptions.
WFLog The WFLog class provides some static helper methods for logging things.
WFModuleInvocation The WFModuleInvocation object is a wrapper around WFModule. This allows the modules to be nicely decoupled from the callers. Thus, the http handler can create a WFModuleInvocation based on the URL, while a WFModuleView can create one based on parameters set by a caller.
WFModule The WFModule represents a single chunk of web application functionality.
WFObjectController The main ObjectController from the Controller Layer.
WFPage The WFPage encapsulates the UI and Controller Layer state of a page.
WFPaginator Base paginator class.
WFRequestController The RequestController object is a singleton controller for the entire request-act-respond cycle.
WFRPC The WFRPC class encapsulates a remote procedure call from the client/UI layer.
WFEvent The WFEvent hierarchy maps to DOM events that PHOCOA can recognize and act on.
WFAction WFAction represents an action that is called when a WFEvent occurs on the client.
WFActionResponse The WFActionResponse hierarchy encapsulates possible responses to Ajax actions.
WFCoder Base Class for all framework classes.
WFSerializerMemento Base Class for all framework classes.
WFSkinManifestDelegate Skin Manifest abstract interface. Each skin will need to have a concrete subclass to provide the system with needed information about itself.
WFSkin Main skin class for managing skin wrappers around the content.
WFWebApplication The WFWebApplication object is a singleton object that manages the running of the any Phocoa request, be it CLI or HTTP.
WFBreadCrumbNode A Breadcrumb system.
WFBreadCrumbSetup A Breadcrumb system.
WFBulkUploadFile Base Class for all framework classes.
WFFormatter WFFormatter
WFView The base "view" class. Views are the components that make up a WFPage. Each page has a root view, and then is made up of various subviews in a view hierarchy. There is also a well-defined class hierarchy for WFView that contains all components that are used in creating a web page.
WFYAHOO_widget_TreeViewNode Helper object for WFYAHOO_widget_TreeView.
Method Summary
static array exposedProperties ()
static void valueForStaticKey ( $key)
static void valueForStaticKeyPath ( $keyPath)
static void valueForTargetAndKeyPath ( $keyPath, [ $rootObject = NULL])
static mixed valueForUndefinedStaticKey (string $key)
static void _valueForStaticKey ( $key,  $target)
WFObject __construct ()
void getClass ()
array keyPathToTargetAndKey ( $keyPath)
void setValueForKey ( $value,  $key)
void setValueForKeyPath ( $value,  $keyPath)
void setValuesForKeys ( $valuesForKeys)
void validatedSetValueForKey ( &$value,  $key,  &$edited,  &$errors)
void validatedSetValueForKeyPath ( &$value,  $keyPath,  &$edited,  &$errors)
boolean validateObject (array &$errors)
boolean validateValueForKey (mixed &$value, string $key, boolean &$edited, array &$errors)
boolean validateValueForKeyPath (mixed &$value, string $keyPath, boolean &$edited, object A &$errors)
void valueForKey ( $key)
void valueForKeyPath ( $keyPath)
mixed valueForUndefinedKey (string $key)
void valuesForKeyPaths ( $keysAndKeyPaths)
void valuesForKeys ( $keys)
void __toString ()
Methods
static method exposedProperties (line 29)

Empty placeholder for exposedProperties setup.

Subclasses should call parent and merge results.

  • access: public
static array exposedProperties ()

Redefined in descendants as:
static method valueForStaticKey (line 363)
  • access: public
static void valueForStaticKey ( $key)
  • $key
static method valueForStaticKeyPath (line 359)
  • access: public
static void valueForStaticKeyPath ( $keyPath)
  • $keyPath
static method valueForTargetAndKeyPath (line 182)
  • access: protected
static void valueForTargetAndKeyPath ( $keyPath, [ $rootObject = NULL])
  • $keyPath
  • $rootObject
static method valueForUndefinedStaticKey (line 177)

Called by valueForStaticKey() if the key cannot be located through normal methods.

The default implementation raises as WFUndefinedKeyException. Subclasses can override this function to return an alternate value for the undefined key.

  • return: The value of the key.
  • throws: object WFUndefinedKeyException
  • access: public
static mixed valueForUndefinedStaticKey (string $key)
  • string $key: The key.
static method _valueForStaticKey (line 34)
  • access: protected
static void _valueForStaticKey ( $key,  $target)
  • $key
  • $target
Constructor __construct (line 18)
WFObject __construct ()

Redefined in descendants as:
getClass (line 603)
void getClass ()

Redefined in descendants as:
keyPathToTargetAndKey (line 409)

Helper function to convert a keyPath into the targetKeyPath (the object to call xxxKey on) and the targetKey (the key to call on the target object).

Usage:

  1.  list($targetKeyPath$targetKeykeyPathToParts($keyPath);

  • return: targetKeyPath, targetKey.
  • access: protected
array keyPathToTargetAndKey ( $keyPath)
  • $keyPath
setValueForKey (line 369)
void setValueForKey ( $value,  $key)
  • $value
  • $key

Redefined in descendants as:
setValueForKeyPath (line 434)
void setValueForKeyPath ( $value,  $keyPath)
  • $value
  • $keyPath
setValuesForKeys (line 131)
void setValuesForKeys ( $valuesForKeys)
  • $valuesForKeys
validatedSetValueForKey (line 474)

Validate, and call setter if valid, a value for a key.

This is the default implementation for this method. It simply calls validateValueForKey and if there are no errors, calls the setter.

void validatedSetValueForKey ( &$value,  $key,  &$edited,  &$errors)
  • &$value
  • $key
  • &$edited
  • &$errors
validatedSetValueForKeyPath (line 541)

Validate, and call setter if valid, a value for a keyPath.

This is the default implementation for this method. It simply calls validateValueForKeyPath and if there are no errors, calls the setter.

void validatedSetValueForKeyPath ( &$value,  $keyPath,  &$edited,  &$errors)
  • &$value
  • $keyPath
  • &$edited
  • &$errors
validateObject (line 500)

Default implementation for validateObject().

The default implementation will call all defined Key-Value Validators (any method matching "^validate*") using validatedSetValueForKey().

Validations are done via validatedSetValueForKey(), meaning that changes made to values by the validators will be updated via setValueForKey.

Subclasses needing to do interproperty validation should override the validateObject() method. If subclasses wish to block the default behavior of re-validating all properties with validators, then the subclass should not call the super method. Subclasses wishing to preserve this behavior should call parent::validateObject($errors).

boolean validateObject (array &$errors)
  • array &$errors: An array, passed by reference, which will be populated with any errors encountered. Errors are grouped by key, ie $errors['key'] = array()
validateValueForKey (line 575)

Validate the given value for the given key.

Clients can normalize the value, and also report and error if the value is not valid.

If the value is valid without modificiation, return TRUE and do not alter $edited or $error. If the value is valid after being modified, return TRUE, and $edited to true. IF the value is not valid, do not alter $value or $edited, but fill out the $error object with desired information.

The default implementation (in WFObject) looks for a method named validate<key> and calls it, otherwise it returns TRUE. Here is the prototype:

  1.       (boolean) function(&$value&$edited&$errors)

  • return: TRUE indicates a valid value, FALSE indicates an error.
boolean validateValueForKey (mixed &$value, string $key, boolean &$edited, array &$errors)
  • mixed &$value: A reference to value to check. Passed by reference so that the implementation can normalize the data.
  • string $key: keyPath the keyPath for the value.
  • boolean &$edited: A reference to a boolean. This value will always be FALSE when the method is called. If the implementation edits the $value, set to TRUE.
  • array &$errors: An array of WFError objects describing the error. The array is empty by default; you can add new error entries with:
    1.           $error[new WFError('My error message')// could also add an error code (string) parameter.
validateValueForKeyPath (line 451)

Validate the given value for the given keypath.

This is the default implementation for this method. It looks for the target object based on the keyPath and then calls the validateValueForKey method.

  • return: TRUE indicates a valid value, FALSE indicates an error.
boolean validateValueForKeyPath (mixed &$value, string $keyPath, boolean &$edited, object A &$errors)
  • mixed &$value: A reference to value to check. Passed by reference so that the implementation can normalize the data.
  • string $keyPath: keyPath the keyPath for the value.
  • boolean &$edited: A reference to a boolean. This value will always be FALSE when the method is called. If the implementation edits the $value, set to TRUE. This will resultion in setValueForKey() being called again with the new value.
  • object A &$errors: WFError object describing the error.
valueForKey (line 78)
void valueForKey ( $key)
  • $key

Redefined in descendants as:
valueForKeyPath (line 354)
  • access: public
void valueForKeyPath ( $keyPath)
  • $keyPath

Redefined in descendants as:
valueForUndefinedKey (line 164)

Called by valueForKey() if the key cannot be located through normal methods.

The default implementation raises as WFUndefinedKeyException. Subclasses can override this function to return an alternate value for the undefined key.

  • return: The value of the key.
  • throws: object WFUndefinedKeyException
mixed valueForUndefinedKey (string $key)
  • string $key: The key.

Redefined in descendants as:
valuesForKeyPaths (line 138)
void valuesForKeyPaths ( $keysAndKeyPaths)
  • $keysAndKeyPaths
valuesForKeys (line 121)
void valuesForKeys ( $keys)
  • $keys
__toString (line 598)
void __toString ()

Redefined in descendants as:

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