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.

  1.  echo $obj->property1;
  2.  echo $obj->getProperty1();
  3.  echo $obj['property1']//$obj may be an array or object
  4.  echo TPropertyAccess($obj'property1');

Setting a property value.

  1.  $obj1->propert1 'hello';
  2.  $obj->setProperty('hello');
  3.  $obj['property1''hello'//$obj may be an array or object
  4.  TPropertyAccess($obj'property1''hello');

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

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

  • author: Wei Zhuo <weizho[at]gmail[dot]com>
  • version: $Id: TPropertyAccess.php 2996 2011-06-20 15:24:57Z ctrlaltca@gmail.com $
  • since: 3.1

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


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

Gets the property value.

  • return: property value.
  • throws: TInvalidDataValueException if property path is invalid.
  • access: public
static mixed get (mixed $object, string $path)
  • mixed $object: object or path.
  • string $path: property path.
static method has (line 90)
  • return: true if property path is valid
  • access: public
static boolean has (mixed $object, string $path)
  • mixed $object: object or array
  • string $path: property path.
static method set (line 129)

Sets the property value.

  • throws: TInvalidDataValueException if property path is invalid.
  • access: public
static 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, 25 Jun 2012 14:38:56 +0200 by phpDocumentor 1.4.3