PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

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');
Package: System\Data\SqlMap
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Wei Zhuo <weizho[at]gmail[dot]com>
Since: 3.1
Located at Data/SqlMap/DataMapper/TPropertyAccess.php
Methods summary
public static mixed
# get( mixed $object, string $path )

Gets the property value.

Gets the property value.

Parameters

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

Returns

mixed
property value.

Throws

TInvalidDataValueException
if property path is invalid.
public static boolean
# has( mixed $object, string $path )

Parameters

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

Returns

boolean
true if property path is valid
public static
# set( mixed & $originalObject, string $path, mixed $value )

Sets the property value.

Sets the property value.

Parameters

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

Throws

TInvalidDataValueException
if property path is invalid.
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO