## Apache Zeta Components Manual :: Docs For Class ezcPersistentRelation

### PersistentObject::ezcPersistentRelation

### Class ezcPersistentRelation

Base class for all relation definition classes of PersistentObject.

Source for this file: /PersistentObject/src/interfaces/relation.php

Version: | //autogen//

### Descendants

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

### 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
--- | ---
`ezcPersistentManyToOneRelation::__construct()` | Create a new relation.
`ezcPersistentManyToManyRelation::__construct()` | Constructs a new many to many relation from the table $sourceTable to the table $destinationTable via $relationTable
`ezcPersistentOneToManyRelation::__construct()` | Create a new relation.
`ezcPersistentOneToOneRelation::__construct()` | Create a new relation.

#### 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.

##### Exceptions:

Type | Description
--- | ---
`ezcBaseValueException` | On an invalid column map.

##### Redefined in descendants as:

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

Documentation generated by phpDocumentor 1.4.3