Path

ez components / documentation / api reference / trunk / persistentobject


eZ Components trunk

PersistentObject: ezcPersistentObjectProperty

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcPersistentObjectProperty

Defines a persistent object field. [source]
An instance of this class is used in a ezcPersisentObjectDefinition object to define a relation between an object property and a database column.

Constants

PHP_TYPE_ARRAY = 4
PHP_TYPE_BOOL = 6
PHP_TYPE_FLOAT = 3
PHP_TYPE_INT = 2
PHP_TYPE_OBJECT = 5
PHP_TYPE_STRING = 1
VISIBILITY_PRIVATE = 1
VISIBILITY_PROPERTY = 4
VISIBILITY_PROTECTED = 2
VISIBILITY_PUBLIC = 3

Properties

string read/write  $columnName
The name of the database field that stores the value.
ezcPersistentPropertyConverter|null read/write  $converter
A converter object that will automatically perform converters on load and save of a property value.
int read/write  $databaseType
Type of the database column, as defined by PDO constants: PDO::PARAM_BOOL, PDO::PARAM_INT, PDO::PARAM_STR (default as defined by ezcQuery::bindValue()) or PDO::PARAM_LOB (important for binary data).
string read/write  $propertyName
The name of the PersistentObject property that holds the value in the PHP object.
int read/write  $propertyType
The type of the PHP property. See class constants PHP_TYPE_*.

Method Summary

public ezcPersistentObjectProperty __construct( [$columnName = null], [$propertyName = null], [$type = self::PHP_TYPE_STRING], [$converter = null], [$databaseType = PDO::PARAM_STR] )
Creates a new property definition object.
public static ezcPersistentObjectProperty __set_state( $array )
Returns a new instance of this class with the data specified by $array.

Methods

__construct

ezcPersistentObjectProperty __construct( [string $columnName = null], [string $propertyName = null], [int $type = self::PHP_TYPE_STRING], [ezcPersistentPropertyConverter $converter = null], [int $databaseType = PDO::PARAM_STR] )
Creates a new property definition object.
Creates a new property definition object from the given values. The $columnName refers to the name of the database column that, the $propertyName to the name of the PHP object property it refers to. The $type defines the type of the resulting PHP property, the database value will be casted accordingly after load.

Parameters

Name Type Description
$columnName string  
$propertyName string  
$type int  
$converter ezcPersistentPropertyConverter  
$databaseType int  

__set_state

ezcPersistentObjectProperty __set_state( $array )
Returns a new instance of this class with the data specified by $array.
$array contains all the data members of this class in the form: array('member_name'=>value).
__set_state makes this class exportable with var_export. var_export() generates code, that calls this method when it is parsed with PHP.

Parameters

Name Type Description
$array array(string=>mixed)  

Last updated: Mon, 21 Dec 2009