From 33b23eda3bc44eefa9672cc7e6b39f2d1b6a5040 Mon Sep 17 00:00:00 2001 From: runa Date: Fri, 3 Nov 2006 20:18:12 +0000 Subject: [PATCH] Added setRelation and getRelations --- lib/Doctrine/Schema/Table.php | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/Schema/Table.php b/lib/Doctrine/Schema/Table.php index c944659f5..d18b4ade8 100644 --- a/lib/Doctrine/Schema/Table.php +++ b/lib/Doctrine/Schema/Table.php @@ -39,7 +39,10 @@ class Doctrine_Schema_Table extends Doctrine_Schema_Object implements Countable, 'check' => '', 'charset' => '', 'description' => ''); - + /** + * Relations this table has with others. An array of Doctrine_Schema_Relation + */ + private $relations = array(); /** * * @return bool @@ -78,4 +81,22 @@ class Doctrine_Schema_Table extends Doctrine_Schema_Object implements Countable, return $this; } + /** + * Adds a relation between a local column and a 2nd table / column + * + * @param Doctrine_Schema_Relation Relation + * + */ + public function setRelation(Doctrine_Schema_Relation $relation){ + $this->relations[] = $relation; + } + /** + * Return all the relations this table has with others + * + * @return array Array of Doctrine_Schema_Relation + */ + public function getRelations(){ + return $this->relations; + } + }