我正在尝试在 kohana 3 web 框架中编写一个非常简单的 cms(用于学习目的)。我有我的数据库模式,我想将它映射到 ORM,但我遇到了关系问题。
一篇文章有一个类别。当然,一个类别可能有很多文章。
我认为它是文章表中的 has_one 关系。(?)
现在php代码。我需要先创建 application/classes/models/article.php,是吗?
class Model_Article extends ORM
{
protected // and i am not sure what i suppose to write here
}