From e1d295f31b61945b6fbc2f0d617070189a78d485 Mon Sep 17 00:00:00 2001 From: zYne Date: Mon, 18 Jun 2007 18:05:16 +0000 Subject: [PATCH] --- tests/classes.php | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/tests/classes.php b/tests/classes.php index 68e3901fc..a5e30d7a9 100644 --- a/tests/classes.php +++ b/tests/classes.php @@ -346,34 +346,42 @@ class ORM_TestItem extends Doctrine_Record { $this->hasOne('ORM_TestEntry', 'ORM_TestEntry.itemID'); } } -class ORM_AccessControl extends Doctrine_Record { - public function setTableDefinition() { +class ORM_AccessControl extends Doctrine_Record +{ + public function setTableDefinition() + { $this->hasColumn('name', 'string', 255); } - public function setUp() { + public function setUp() + { $this->hasMany('ORM_AccessGroup as accessGroups', 'ORM_AccessControlsGroups.accessGroupID'); } } -class ORM_AccessGroup extends Doctrine_Record { - public function setTableDefinition() { +class ORM_AccessGroup extends Doctrine_Record +{ + public function setTableDefinition() + { $this->hasColumn('name', 'string', 255); } - public function setUp() { + public function setUp() + { $this->hasMany('ORM_AccessControl as accessControls', 'ORM_AccessControlsGroups.accessControlID'); } } -class ORM_AccessControlsGroups extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('accessControlID', 'integer', 11); - $this->hasColumn('accessGroupID', 'integer', 11); - - $this->setPrimaryKey(array('accessControlID', 'accessGroupID')); +class ORM_AccessControlsGroups extends Doctrine_Record +{ + public function setTableDefinition() + { + $this->hasColumn('accessControlID', 'integer', 11, array('primary' => true)); + $this->hasColumn('accessGroupID', 'integer', 11, array('primary' => true)); } } -class EnumTest extends Doctrine_Record { - public function setTableDefinition() { +class EnumTest extends Doctrine_Record +{ + public function setTableDefinition() + { $this->hasColumn('status', 'enum', 11, array('values' => array('open', 'verified', 'closed'))); } }