From bea3d56374cb9368060c55cf95c8862f35a68b64 Mon Sep 17 00:00:00 2001 From: zYne Date: Thu, 20 Sep 2007 20:31:49 +0000 Subject: [PATCH] --- models/Blog.php | 5 +++-- models/BlogTag.php | 15 +++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/models/Blog.php b/models/Blog.php index 6fdefc39b..6f821c6ee 100644 --- a/models/Blog.php +++ b/models/Blog.php @@ -14,16 +14,17 @@ class Taggable extends Doctrine_Template { public function setUp() { - $this->hasMany('[Component]Tag as Tag'); + $this->hasMany('[Component]TagTemplate as Tag'); } } -class TagTemplate extends Doctrine_Template +class TagTemplate extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('name', 'string', 100); $this->hasColumn('description', 'string'); } + public function setUp() { $this->hasOne('[Component]', array('onDelete' => 'CASCADE')); diff --git a/models/BlogTag.php b/models/BlogTag.php index 918354bfc..f20552ab7 100644 --- a/models/BlogTag.php +++ b/models/BlogTag.php @@ -1,10 +1,13 @@ hasMany('Photo', 'Phototag.photo_id'); - } - public function setTableDefinition() { - $this->hasColumn('tag', 'string', 100); - } + public function setTableDefinition() + { + $this->hasColumn('name', 'string', 100); + $this->hasColumn('description', 'string'); + } + public function setUp() + { + $this->hasOne('Blog', array('onDelete' => 'CASCADE')); + } }