PersistentObject: ezcPersistentObjectProperty
[ ]
[ ]
[ ]
[ ]
[ ]
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
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], [
$converter = null], [
$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 |
|
|
$databaseType |
|
|
__set_state
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: Tue, 27 May 2008