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.
  • todo: How to set up a write-only binding if that stuff is only in WFBinding? For example, see WFUpload (value should be write-only)

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

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 100)
  • var: The type of the binding. One of WFBINDINGTYPE_SINGLE, WFBINDINGTYPE_MULTIPLE_BOOLEAN, WFBINDINGTYPE_MULTIPLE_PATTERN.
  • access: protected
int $booleanMode (line 104)
  • var: The boolean mode for WFBINDINGTYPE_MULTIPLE_BOOLEAN bindings.
  • access: protected
string $boundProperty (line 96)
  • var: The name of the bound proprety.
  • access: protected
string $description (line 108)
  • var: A brief description of the binding's purpose.
  • access: protected
assoc_array $options (line 112)
  • var: A list of all supported option keys for this binding, along with the default value.
  • access: protected
boolean $readOnly (line 116)
  • var: Is the binding read-only?
  • access: protected
Methods
Constructor __construct (line 118)
WFBindingSetup __construct ( $boundPropName, [ $boundPropDescription = NULL], [ $options = NULL])
  • $boundPropName
  • $boundPropDescription
  • $options

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

Get the bindingType.

int bindingType ()
booleanMode (line 141)

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 228)

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

string boundProperty ()
description (line 238)

A human-readable description of the binding.

string description ()
getOptionDefault (line 248)

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 254)
void options ()
readOnly (line 206)

Is this binding read-only?

boolean readOnly ()
setBindingType (line 184)

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 154)

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 218)

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::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()
Class Constants
WFBINDINGSETUP_INSERTS_NULL_PLACEHOLDER = 'InsertsNullPlaceholder' (line 90)
WFBINDINGSETUP_NULL_PLACEHOLDER = 'NullPlaceholder' (line 91)
WFBINDINGSETUP_PATTERN_OPTION_NAME = 'ValuePattern' (line 88)
WFBINDINGSETUP_PATTERN_OPTION_VALUE = '%1%' (line 89)
WFBINDINGTYPE_MULTIPLE_BOOLEAN = 1 (line 80)
WFBINDINGTYPE_MULTIPLE_BOOLEAN_AND = 1 (line 84)
WFBINDINGTYPE_MULTIPLE_BOOLEAN_OR = 2 (line 85)
WFBINDINGTYPE_MULTIPLE_PATTERN = 2 (line 81)
WFBINDINGTYPE_SINGLE = 0 (line 79)

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