From e69284cc208e2c6fc0f7bf3054a7945ed5e3e795 Mon Sep 17 00:00:00 2001 From: zYne Date: Thu, 14 Jun 2007 18:46:37 +0000 Subject: [PATCH] --- .../object-relational-mapping/relations.txt | 48 ------------------- 1 file changed, 48 deletions(-) delete mode 100644 manual/new/docs/en/object-relational-mapping/relations.txt diff --git a/manual/new/docs/en/object-relational-mapping/relations.txt b/manual/new/docs/en/object-relational-mapping/relations.txt deleted file mode 100644 index e1720fbea..000000000 --- a/manual/new/docs/en/object-relational-mapping/relations.txt +++ /dev/null @@ -1,48 +0,0 @@ -+++ Introduction - -In Doctrine all record relations are being set with {{hasMany}}, {{hasOne}}, {{ownsMany}} and {{ownsOne}} methods. Doctrine supports almost any kind of database relation from simple one-to-one foreign key relations to join table self-referencing relations. - - -+++ Relation aliases - -Doctrine supports relation aliases through {{as}} keyword. - - -class Forum_Board extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('name', 'string', 100); - $this->hasColumn('description', 'string', 5000); - } - public function setUp() { - // notice the 'as' keyword here - $this->ownsMany('Forum_Thread as Threads', 'Forum_Thread.board_id'); - } -} - -class Forum_Thread extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('board_id', 'integer', 10); - $this->hasColumn('updated', 'integer', 10); - $this->hasColumn('closed', 'integer', 1); - } - public function setUp() { - // notice the 'as' keyword here - $this->hasOne('Forum_Board as Board', 'Forum_Thread.board_id'); - } -} -$board = new Board(); -$board->Threads[0]->updated = time(); - - - -+++ Foreign key associations - - -+++ Join table associations - - -+++ Inheritance - - -+++ Foreign key constraints -