## Class TPropertyAccess

Description

TPropertyAccess class provides dot notation stype property access and setting.

Access object's properties (and subproperties) using dot path notation. The following are equivalent.

     echo $obj->property1;
     echo $obj->getProperty1();
     echo $obj['property1']; //$obj may be an array or object
      echo TPropertyAccess($obj, 'property1');

Setting a property value.

     $obj1->propert1 = 'hello';
     $obj->setProperty('hello');
     $obj['property1'] = 'hello'; //$obj may be an array or object
      TPropertyAccess($obj, 'property1', 'hello');

Subproperties are supported using the dot notation. E.g.

     echo $obj->property1->property2->property3
     echo TPropertyAccess::get($obj, 'property1.property2.property3');

- since: 3.1
- version: $Id: TPropertyAccess.php 1568 2006-12-09 09:17:22Z wei $
- author: Wei Zhuo <weizho[at]gmail[dot]com>

Located in /Data/SqlMap/DataMapper/TPropertyAccess.php (line 44)

Method Summary
mixed get (mixed $object, string $path)
boolean has (mixed $object, string $path)
void set (mixed &$originalObject, string $path, mixed $value)
Methods
get (line 53)

Gets the property value.

- return: property value.
- static:
- access: public
- throws: TInvalidDataValueException if property path is invalid.

mixed get (mixed $object, string $path)

- mixed $object: object or path.
- string $path: property path.

has (line 88)

- return: true if property path is valid
- static:
- access: public

boolean has (mixed $object, string $path)

- mixed $object: object or array
- string $path: property path.

set (line 124)

Sets the property value.

- static:
- access: public
- throws: TInvalidDataValueException if property path is invalid.

void set (mixed &$originalObject, string $path, mixed $value)

- mixed &$originalObject: object or array
- string $path: property path.
- mixed $value: new property value.

Documentation generated on Sun, 30 Sep 2007 19:17:02 -0400 by phpDocumentor 1.3.0RC4