From 870ce44263a6c1e8b6102ea7ca0903b7d1292431 Mon Sep 17 00:00:00 2001 From: runa Date: Fri, 3 Nov 2006 20:17:16 +0000 Subject: [PATCH] Relation is the relation between 1 column in the local table and 1 column in a second table --- lib/Doctrine/Schema/Relation.php | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/lib/Doctrine/Schema/Relation.php b/lib/Doctrine/Schema/Relation.php index ab0959f31..8be36972b 100644 --- a/lib/Doctrine/Schema/Relation.php +++ b/lib/Doctrine/Schema/Relation.php @@ -36,16 +36,23 @@ class Doctrine_Schema_Relation extends Doctrine_Schema_Object { /** - * Columns that refer to another table + * Column that refers to another table * @access public */ - public $referencingFields; + public $referencingColumn; /** - * Columns that are referred from another table + * Column that is referred from another table * @access public */ - public $referredFields; + public $referencedColumn; + + /** + * Table where the referred column lives + * @access public + * + */ + public $referencedTable; /** * ON UPDATE or ON DELETE action @@ -85,13 +92,16 @@ class Doctrine_Schema_Relation extends Doctrine_Schema_Object { /** * - * @param Doctrine_Schema_Column referringColumns - * @param Doctrine_Schema_Column referencedColumns + * @param Doctrine_Schema_Column referencing + * @param Doctrine_Schema_Table referencedtable + * @param Doctrine_Schema_Column referencedColumn * @return * @access public */ - public function setRelationBetween( $referringColumns, $referencedColumns ) { - + public function setRelationBetween( $referencingColumn, $referencedTable, $referencedColumn ) { + $this->referencingColumn = $referencingColumn; + $this->referencedTable = $referencedTable; + $this->referencedColumn = $referencedColumn; } /** * @@ -99,7 +109,7 @@ class Doctrine_Schema_Relation extends Doctrine_Schema_Object { * @access public */ public function __toString( ) { - + return "Relation between '".$this->referencingColumn."' and '".$this->referencedTable."'.'".$this->referencingColumn."'"; } /** *