开发者

Kohana ORM syntax question

I'm using the "join_t开发者_开发技巧able" function with Kohana's ORM to build a query. The following works:

$category = ORM::factory('category')->join_table('product');

But this doesn't:

$category = ORM::factory('category');
$category->join_table('product');

The documentation uses the second as an example, but it returns 0 while the first example returns "categories_products" which is correct. Any ideas?


I use Kohana, but I'm not familiar with its ORM. The problem with what you're asking is I don't see how it's possible on the php level. Those 2 statements are identical regardless of how they are implemented in Kohana. How exactly are you checking the return value of the second function?

Notice that in the second example, you aren't assigning $category to the return value of join_table like you are in the first one. Could that be your problem?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜