From 797cdece48327eaed8814c54ff57e5e52de86f91 Mon Sep 17 00:00:00 2001 From: lsmith Date: Fri, 11 May 2007 18:34:56 +0000 Subject: [PATCH] - typo fixes --- ...lations - Inheritance - Column aggregation.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/manual/docs/Object relational mapping - Relations - Inheritance - Column aggregation.php b/manual/docs/Object relational mapping - Relations - Inheritance - Column aggregation.php index 3eee55337..c31023b8d 100644 --- a/manual/docs/Object relational mapping - Relations - Inheritance - Column aggregation.php +++ b/manual/docs/Object relational mapping - Relations - Inheritance - Column aggregation.php @@ -5,14 +5,14 @@ The entity table has a column called 'type' which tells whether an entity is a g The only thing we have to do is to create 3 records (the same as before) and add call the Doctrine_Table::setInheritanceMap() method inside the setUp() method. -class Entity extends Doctrine_Record { +class Entity extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('name','string',30); $this->hasColumn('username','string',20); $this->hasColumn('password','string',16); $this->hasColumn('created','integer',11); - - // this column is used for column + + // this column is used for column // aggregation inheritance $this->hasColumn('type', 'integer', 11); } @@ -34,17 +34,17 @@ class Group extends Entity { If we want to be able to fetch a record from the Entity table and automatically get a User record if the Entity we fetched is a user we have to do set the subclasses option in the parent class. The adjusted example: -class Entity extends Doctrine_Record { +class Entity extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('name','string',30); $this->hasColumn('username','string',20); $this->hasColumn('password','string',16); $this->hasColumn('created','integer',11); - - // this column is used for column + + // this column is used for column // aggregation inheritance $this->hasColumn('type', 'integer', 11); - $this->option('subclasses', array('User', 'Group'); + $this->option('subclasses', array('User', 'Group')); } } @@ -84,4 +84,3 @@ $group = $q->from('Entity')->where('id=?')->execute(array($group->id))->getFirst The user object is here an instance of User while the group object is an instance of Group. -