Class WFBindingSetup

Description

The WFBindingSetup object contains all of the static information about available bindings for a class.

This information can be used for documentation, to get the default values for certain options at runtime, etc.

These instances are typically created in the setupExposedBindings callback of the WFKeyValueBindingCreation protocol.

  • todo: Refactor constants to WFBinding.

Located in /framework/WFBinding.php (line 75)

WFObject
   |
   --WFBindingSetup
Class Constant Summary
Variable Summary
string $description
assoc_array $options
boolean $readOnly
Method Summary
WFBindingSetup __construct ( $boundPropName, [ $boundPropDescription = NULL], [ $options = NULL])
int bindingType ()
int booleanMode ()
string boundProperty ()
string description ()
mixed getOptionDefault (string $optName)
void options ()
boolean readOnly ()
void setBindingType (int $type)
void setBooleanMode (int $mode)
void setReadOnly (boolean $ro)
Variables
int $bindingType (line 99)
  • var: The type of the binding. One of WFBINDINGTYPE_SINGLE, WFBINDINGTYPE_MULTIPLE_BOOLEAN, WFBINDINGTYPE_MULTIPLE_PATTERN.
  • access: protected
int $booleanMode (line 103)
  • var: The boolean mode for WFBINDINGTYPE_MULTIPLE_BOOLEAN bindings.
  • access: protected
string $boundProperty (line 95)
  • var: The name of the bound proprety.
  • access: protected
string $description (line 107)
  • var: A brief description of the binding's purpose.
  • access: protected
assoc_array $options (line 111)
  • var: A list of all supported option keys for this binding, along with the default value.
  • access: protected
boolean $readOnly (line 115)
  • var: Is the binding read-only?
  • access: protected
Methods
Constructor __construct (line 117)
WFBindingSetup __construct ( $boundPropName, [ $boundPropDescription = NULL], [ $options = NULL])
  • $boundPropName
  • $boundPropDescription
  • $options

Redefinition of:
WFObject::__construct()
bindingType (line 165)

Get the bindingType.

int bindingType ()
booleanMode (line 140)

Get the boolean mode of a boolean binding.

  • return: One of WFBindingSetup::WFBINDINGTYPE_MULTIPLE_BOOLEAN_AND or WFBindingSetup::WFBINDINGTYPE_MULTIPLE_BOOLEAN_OR
int booleanMode ()
boundProperty (line 227)

The name of the property of the object that this binding setup applies to.

string boundProperty ()
description (line 237)

A human-readable description of the binding.

string description ()
getOptionDefault (line 247)

Get the default option for the given binding option name.

  • return: The default value for the option.
mixed getOptionDefault (string $optName)
  • string $optName: The name of the option.
options (line 253)
void options ()
readOnly (line 205)

Is this binding read-only?

boolean readOnly ()
setBindingType (line 183)

Set the type of this binding.

There are multiple binding types, each of which provides certain behaviors for the binding.

  1. WFBINDINGTYPE_SINGLE Is the simplest type; this binding type maps data from an object to the UI and potentially vice-versa (if it is not read only).
  2. WFBINDINGTYPE_MULTIPLE_BOOLEAN Links multiple values together, combined by booleanMode.
  3. WFBINDINGTYPE_MULTIPLE_PATTERN Allows for the creation of a string based on a patter, filled with multiple values.
All of the multiple binding types are read-only by definition because the combination is not reversible.

  • throws: Exception if an illegal type is passed.
void setBindingType (int $type)
  • int $type: One of the allowed bindingTypes.
setBooleanMode (line 153)

Set the boolean mode of a boolean binding.

Boolean bindings will combine multiple values by logical AND or logical OR depending on the booleanMode.

  • throws: Exception if the passed mode is not valid.
void setBooleanMode (int $mode)
  • int $mode: One of WFBindingSetup::WFBINDINGTYPE_MULTIPLE_BOOLEAN_AND or WFBindingSetup::WFBINDINGTYPE_MULTIPLE_BOOLEAN_OR.
setReadOnly (line 217)

Set whether this binding is read-only.

Read-only bindings will not propagate data from the UI to the bound object.

void setReadOnly (boolean $ro)
  • boolean $ro: TRUE to set the binding as read-only.

Inherited Methods

Inherited From WFObject

WFObject::__construct()
WFObject::exposedProperties()
WFObject::getClass()
WFObject::keyPathToTargetAndKey()
WFObject::setValueForKey()
WFObject::setValueForKeyPath()
WFObject::validateValueForKey()
WFObject::validateValueForKeyPath()
WFObject::valueForKey()
WFObject::valueForKeyPath()
WFObject::valueForUndefinedKey()
WFObject::__toString()
Class Constants
WFBINDINGSETUP_INSERTS_NULL_PLACEHOLDER = 'InsertsNullPlaceholder' (line 89)
WFBINDINGSETUP_NULL_PLACEHOLDER = 'NullPlaceholder' (line 90)
WFBINDINGSETUP_PATTERN_OPTION_NAME = 'ValuePattern' (line 87)
WFBINDINGSETUP_PATTERN_OPTION_VALUE = '%1%' (line 88)
WFBINDINGTYPE_MULTIPLE_BOOLEAN = 1 (line 79)
WFBINDINGTYPE_MULTIPLE_BOOLEAN_AND = 1 (line 83)
WFBINDINGTYPE_MULTIPLE_BOOLEAN_OR = 2 (line 84)
WFBINDINGTYPE_MULTIPLE_PATTERN = 2 (line 80)
WFBINDINGTYPE_SINGLE = 0 (line 78)

Documentation generated on Sun, 28 Sep 2008 18:24:27 -0400 by phpDocumentor 1.4.1