From c64b774baa2c00d842497a98004835554d035a3b Mon Sep 17 00:00:00 2001 From: meus Date: Mon, 3 Sep 2007 16:01:34 +0000 Subject: [PATCH] change old way of declaring definitions to new one --- models/BoardWithPosition.php | 2 +- models/CategoryWithPosition.php | 2 +- models/Forum_Board.php | 4 ++-- models/Forum_Entry.php | 4 ++-- models/Forum_Thread.php | 4 ++-- models/export/Cms_Cateogry.php | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/models/BoardWithPosition.php b/models/BoardWithPosition.php index 0a23c8839..e7a201ab4 100644 --- a/models/BoardWithPosition.php +++ b/models/BoardWithPosition.php @@ -5,6 +5,6 @@ class BoardWithPosition extends Doctrine_Record { $this->hasColumn('category_id', 'integer'); } public function setUp() { - $this->hasOne('CategoryWithPosition as Category', 'BoardWithPosition.category_id'); + $this->hasOne('CategoryWithPosition as Category', array('local' => 'category_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); } } diff --git a/models/CategoryWithPosition.php b/models/CategoryWithPosition.php index 53dd2f8ce..d205e3922 100644 --- a/models/CategoryWithPosition.php +++ b/models/CategoryWithPosition.php @@ -5,6 +5,6 @@ class CategoryWithPosition extends Doctrine_Record { $this->hasColumn('name', 'string', 255); } public function setUp() { - $this->ownsMany('BoardWithPosition as Boards', 'BoardWithPosition.category_id'); + $this->hasMany('BoardWithPosition as Boards', array('local' => 'id' , 'foreign' => 'category_id')); } } diff --git a/models/Forum_Board.php b/models/Forum_Board.php index 196bc6544..6bb679fc9 100644 --- a/models/Forum_Board.php +++ b/models/Forum_Board.php @@ -6,8 +6,8 @@ class Forum_Board extends Doctrine_Record { $this->hasColumn('description', 'string', 5000); } public function setUp() { - $this->hasOne('Forum_Category as Category', 'Forum_Board.category_id'); - $this->ownsMany('Forum_Thread as Threads', 'Forum_Thread.board_id'); + $this->hasOne('Forum_Category as Category', array('local' => 'category_id', 'foreign' => 'id')); + $this->hasMany('Forum_Thread as Threads', array('local' => 'id', 'foreign' => 'board_id')); } } diff --git a/models/Forum_Entry.php b/models/Forum_Entry.php index ccccb8340..91817dec0 100644 --- a/models/Forum_Entry.php +++ b/models/Forum_Entry.php @@ -9,8 +9,8 @@ class Forum_Entry extends Doctrine_Record { $this->hasColumn('date', 'integer', 10); } public function setUp() { - $this->hasOne('Forum_Entry as Parent', 'Forum_Entry.parent_entry_id'); - $this->hasOne('Forum_Thread as Thread', 'Forum_Entry.thread_id'); + $this->hasOne('Forum_Entry as Parent', array('local' => 'id', 'foreign' => 'parent_entry_id')); + $this->hasOne('Forum_Thread as Thread', array('local' => 'thread_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); } } diff --git a/models/Forum_Thread.php b/models/Forum_Thread.php index 6911f3dec..afac222c7 100644 --- a/models/Forum_Thread.php +++ b/models/Forum_Thread.php @@ -6,8 +6,8 @@ class Forum_Thread extends Doctrine_Record { $this->hasColumn('closed', 'integer', 1); } public function setUp() { - $this->hasOne('Forum_Board as Board', 'Forum_Thread.board_id'); - $this->ownsMany('Forum_Entry as Entries', 'Forum_Entry.thread_id'); + $this->hasOne('Forum_Board as Board', array('local' => 'board_id', 'foreign' => 'id', 'onDelete' => 'CASCADE')); + $this->hasMany('Forum_Entry as Entries', array('local' => 'id', 'foreign' => 'thread_id')); } } diff --git a/models/export/Cms_Cateogry.php b/models/export/Cms_Cateogry.php index e4f31c56a..71db71650 100644 --- a/models/export/Cms_Cateogry.php +++ b/models/export/Cms_Cateogry.php @@ -4,7 +4,7 @@ class Cms_Category extends Doctrine_Record public function setUp() { - $this->ownsMany('Cms_CategoryLanguages as langs', array('local' => 'id', 'foreign' => 'category_id')); + $this->hasMany('Cms_CategoryLanguages as langs', array('local' => 'id', 'foreign' => 'category_id')); } public function setTableDefinition()