## 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 2644 2009-05-01 08:30:05Z godzilla80@gmx.net $
- 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 90)

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

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 Mon, 22 Feb 2010 12:18:24 +0000 by phpDocumentor 1.3.0RC4