change old way of declaring definitions to new one
This commit is contained in:
parent
a975c64de1
commit
c64b774baa
@ -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'));
|
||||
}
|
||||
}
|
||||
|
@ -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'));
|
||||
}
|
||||
}
|
||||
|
@ -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'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user