數據庫表我有以下設置爲我的CakePHP應用程序: Posts
id
title
content
Topics
id
title
Topic_Posts
id
topic_id
post_id
所以基本上我的主題(標籤)的表都是獨一無二的,並有一個ID。然後可以使用Topic_Posts連接表附加它們以發佈。當用戶創建新帖子時,他們將填入主題,方法是將用逗號分隔的tex
我正在嘗試編寫一個模型方法,以便將帖子附加到帖子中。數據庫設置如下: Post
id
title
Topic
id
title
Post_Topic
id
post_id
topic_id
和實例方法... public function getPostTopics($postId)
{
$topics = $this->find('all', ...