- Home
- About
- Testimonials
- Demos
- Download
- Documentation
- Blogs
- Forum
- Support

Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml
Classes:
TInvalidPropertyException
TLazyLoadList
TObjectProxy
TPropertyAccess
TSqlMapApplicationCache
TSqlMapCache
TSqlMapConfig
TSqlMapConfigurationException
TSqlMapDuplicateException
TSqlMapException
TSqlMapExecutionException
TSqlMapFifoCache
TSqlMapGateway
TSqlMapLruCache
TSqlMapManager
TSqlMapPagedList
TSqlMapTypeHandler
TSqlMapTypeHandlerRegistry
TSqlMapUndefinedException

Keyword

# Class TPropertyAccess

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
Author: Wei Zhuo <weizho[at]gmail[dot]com>

Method Summary
mixed | get ( mixed $object, string $path) Gets the property value.
boolean | has ( mixed $object, string $path)
void | set ( mixed &$originalObject, string $path, mixed $value) Sets the property value.

Method Details

## get

public mixed get | (mixed $object , string $path )

Gets the property value.

Input
mixed | $object | object or path.
string | $path | property path.
Output
mixed | property value.
Exception
throws | TInvalidDataValueException if property path is invalid.

## has

public boolean has | (mixed $object , string $path )

Input
mixed | $object | object or array
string | $path | property path.
Output
boolean | true if property path is valid
Exception

## set

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

Sets the property value.

Input
mixed | &$originalObject | object or array
string | $path | property path.
mixed | $value | new property value.
Output
Exception
throws | TInvalidDataValueException if property path is invalid.