Zeta Components - high quality PHP components

Zeta Components Manual :: Docs For Class ezcPersistentObjectDefinition

PersistentObject::ezcPersistentObjectDefinition

Class ezcPersistentObjectDefinition

Main definition of a persistent object.

Each persistent object will have exactly one definition. The purpose of the definition is to provide information about how the database table is structured and how it is mapped to the data object.

For an elaborate example see ezcPersistentSession.

Source for this file: /PersistentObject/src/object/persistent_object_definition.php

Version:   //autogen//

Properties

string read/write $class
Class-name of the PersistentObject.
array(string=>ezcPersistentObjectProperty) read/write $columns
The fields of the Persistent Object as an array of ezcPersistentObjectProperty. The key is the name of the original database column.
ezcPersistentObjectIdProperty read/write $idProperty
Holds the identifier property.
array(string=>ezcPersistentObjectProperty) read/write $properties
The fields of the Persistent Object as an array of ezcPersistentObjectProperty.
array(string=>ezcPersistentRelation) read/write $relations
Contains the relations of this object. An array indexed by class names of the related object, assigned to a instance of a class derived from ezcPersistentRelation.
string read/write $table
Name of the database table to use.

Member Variables

protected array(string=>mixed) $propertyArray = array(
'table' => null,
'class' => null,
'idProperty' => null,
'properties' => null,
'columns' => null,
'relations' => null,
)

Property array.

Named differently to avoid problems with the property $properties.

Method Summary

public static ezcPersistentObjectDefinition __set_state( $array )
Returns a new instance of this class with the data specified by $array.
public ezcPersistentObjectDefinition __construct( [ $table = ''] , [ $class = ''] , [ $properties = array()] , [ $relations = array()] , [ $idProperty = null] )
Constructs a new PersistentObjectDefinition.

Methods

__set_state

static ezcPersistentObjectDefinition __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)

__construct

ezcPersistentObjectDefinition __construct( [string $table = ''] , [string $class = ''] , [ $properties = array()] , [ $relations = array()] , [ezcPersistentObjectIdProperty $idProperty = null] )

Constructs a new PersistentObjectDefinition.

Parameters:
Name Type Description
$table string The name of the database table to map to.
$class string The name of the PHP class to map to.
$properties array The properties of the class. See $properties
$relations array The relations of the class. See $relations
$idProperty ezcPersistentObjectIdProperty The primary key of the class/table.
Documentation generated by phpDocumentor 1.4.3