Path

ez components / documentation / api reference / 2009.1 / persistentobject


eZ Components 2009.1

PersistentObject: ezcPersistentRelation

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

Class: ezcPersistentRelation

Base class for all relation definition classes of PersistentObject. [source]

Descendents

Child Class Description
ezcPersistentOneToOneRelation Relation class to reflect a one-to-one table relation (1:1).
ezcPersistentManyToOneRelation Relation class to reflect a many-to-one table relation (m:1).
ezcPersistentOneToManyRelation Relation class to reflect a one-to-many table relation (1:n).
ezcPersistentManyToManyRelation Relation class to reflect a many-to-many table relation (m:n).

Properties

array read/write  $columnMap
The table mapping this instance reflects.
string read/write  $destinationTable
The destination table this relation maps to.
bool read/write  $reverse
Wether this relation is a reverse of an existing relation.
string read/write  $sourceTable
The source table this relation maps from.

Member Variables

protected array $properties = array(
"sourceTable" => null,
"destinationTable" => null,
"columnMap" => array(),"reverse"=>false,)

Properties array.

Method Summary

public ezcPersistentRelation __construct( $sourceTable, $destinationTable )
Create a new relation.
protected abstract void validateColumnMap( $columnMap )
Validates an ezcPersistentRelation::$columnMap property.

Methods

__construct

ezcPersistentRelation __construct( string $sourceTable, string $destinationTable )
Create a new relation.

Parameters

Name Type Description
$sourceTable string See property $sourceTable
$destinationTable string See property $destinationTable

Redefined in descendants as

Method Description
ezcPersistentOneToOneRelation::__construct() Create a new relation.
ezcPersistentManyToOneRelation::__construct() Create a new relation.
ezcPersistentOneToManyRelation::__construct() Create a new relation.
ezcPersistentManyToManyRelation::__construct() Constructs a new many to many relation from the table $sourceTable to the table $destinationTable via $relationTable

validateColumnMap

void validateColumnMap( $columnMap )
Validates an ezcPersistentRelation::$columnMap property.
Checks is the given array represents a valid $columnMap property. Has to be implemented by all derived classes.

Parameters

Name Type Description
$columnMap array The column map to check.

Throws

ClassDescription
ezcBaseValueException On an invalid column map.

Redefined in descendants as

Method Description
ezcPersistentOneToOneRelation::validateColumnMap() Validates an ezcPersistentRelation::$columnMap property.
ezcPersistentManyToOneRelation::validateColumnMap() Validates an ezcPersistentRelation::$columnMap property.
ezcPersistentOneToManyRelation::validateColumnMap() Validates an ezcPersistentRelation::$columnMap property.
ezcPersistentManyToManyRelation::validateColumnMap() Validates an ezcPersistentRelation::$columnMap property.

Last updated: Mon, 29 Jun 2009