Class WFBinding

Description

The binding object.

The binding object encapsulates all information about a particular bound property of an object. These instances are created at runtime each time the bind function of the WFKeyValueBindingCreation protocol is used.

Note class constants named OPTION_*. These are available binding options for use as described.

Built-in Binding Options:

  • ValueTransformer : A class name of a WFValueTransformer subclass such as WFIsEmpty, WFIsNotEmpty, WFNegateBoolean
  • ValuePattern : Used by WFBINDINGTYPE_MULTIPLE_PATTERN bindings; can bind value to a single value created by substituting multiple values in a string, such as "%1% of %2%".
  • Formatter : A string pointing to a formatter instance to use for the value option; useful for WFBINDINGTYPE_MULTIPLE_PATTERN bindings. For single-value bindings, use WFWidget::$formatter
  • InsertsNullPlaceholder : A boolean value; true to have the bindings system use the value specified in 'NullPlaceholder' instead of NULL for the value.
  • NullPlaceholder : The value displayed in the UI which is substitued for NULL.
  • ReadWriteMode : Used to control whether the binding will be "normal" (read-write), "readonly", or "writeonly". Useful in some circumstances when linking a UI to a read-only attribute.

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

WFObject
   |
   --WFBinding
Class Constant Summary
Variable Summary
Method Summary
WFBinding __construct ()
string bindLocalProperty ()
void bindToKeyPath ()
void bindToObject ()
void formatter ()
void option ( $name)
void options ()
void setBindLocalProperty (string $localPropName)
void setBindToKeyPath ( $keyPath)
void setBindToObject ( $obj)
void setOption ( $name,  $value)
void setOptions ( $options)
Variables
object WFBindingSetup $bindingSetup (line 324)
  • var: A reference to the binding setup for this binding.
  • access: protected
string $bindLocalProperty (line 328)
  • var: The name of the local property of the object being bound.
  • access: protected
string $bindToKeyPath (line 308)
  • var: The keyPath on the $bindToObject that this binding is bound to.
  • access: protected
object The $bindToObject (line 304)
  • var: object that this property is bound to.
  • access: protected
assoc_array $options (line 319)
  • var: All of the various options that the binding supports. Each binding may have extra properties that it needs to know, and can be configured.
  • access: protected
boolean $raisesForNotApplicableKeys (line 313)
  • var: Should an exception be raised if the binding cannot be resolved? If false, the bindings system may log the exception.
  • access: protected
Methods
Constructor __construct (line 330)
WFBinding __construct ()

Redefinition of:
WFObject::__construct()
bindingSetup (line 348)

The WFBindingSetup object that this binding instance is for.

object WFBindingSetup bindingSetup ()
bindLocalProperty (line 371)

The property of the object that this binding applies to.

string bindLocalProperty ()
bindToKeyPath (line 391)
void bindToKeyPath ()
bindToObject (line 400)
void bindToObject ()
canReadBoundValue (line 448)
void canReadBoundValue ()
canWriteBoundValue (line 455)
void canWriteBoundValue ()
formatter (line 429)
void formatter ()
option (line 414)
void option ( $name)
  • $name
options (line 409)
void options ()
raisesForNotApplicableKeys (line 386)
void raisesForNotApplicableKeys ()
setBindingSetup (line 360)

Set the WFBindingSetup object that this binding instance is for.

In the case of Multi-Value bindings, each binding instance will point to the same "base" WFBindingSetup.

void setBindingSetup (object WFBindingSetup $bs)
setBindLocalProperty (line 381)

Set the property of the object that this binding applies to.

void setBindLocalProperty (string $localPropName)
  • string $localPropName
setBindToKeyPath (line 395)
void setBindToKeyPath ( $keyPath)
  • $keyPath
setBindToObject (line 404)
void setBindToObject ( $obj)
  • $obj
setOption (line 420)
void setOption ( $name,  $value)
  • $name
  • $value
setOptions (line 424)
void setOptions ( $options)
  • $options
valueTransformerName (line 463)
void valueTransformerName ()

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
OPTION_FORMATTER = 'Formatter' (line 282)
OPTION_INSERTS_NULL_PLACEHOLDER = 'InsertsNullPlaceholder' (line 293)
OPTION_NULL_PLACEHOLDER = 'NullPlaceholder' (line 294)
OPTION_READ_WRITE_MODE = 'ReadWriteMode' (line 296)
OPTION_READ_WRITE_MODE_NORMAL = 'normal' (line 297)
OPTION_READ_WRITE_MODE_READ_ONLY = 'readonly' (line 299)
OPTION_READ_WRITE_MODE_WRITE_ONLY = 'writeonly' (line 298)
OPTION_VALUE_PATTERN = 'ValuePattern' (line 287)
OPTION_VALUE_PATTERN_DEFAULT_PATTERN = '%1%' (line 288)
OPTION_VALUE_TRANSFORMER = 'ValueTransformer' (line 281)

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