1
我在Kohana的ORM中使用「join_table」函數來構建查詢。以下作品:Kohana ORM語法問題
$category = ORM::factory('category')->join_table('product');
但這並不:
$category = ORM::factory('category');
$category->join_table('product');
的文檔使用第二個作爲一個例子,但在第一個例子返回「categories_products」這是正確的,它返回0。有任何想法嗎?
+1只要打我:) – Cocowalla 2010-04-09 18:06:13
找到值,我使用「返回$ category」。你是什麼意思「你沒有像第一個那樣將$ category分配給join_table的返回值」? – anthony 2010-04-09 18:36:54
@anthony在你的第一個例子中,無論'join_table'返回分配給'$ category'。在第二個例子中,'$ category'包含'ORM :: factory()'的返回值。爲了使這些例子等價,將第二個例子的第二行改爲:'$ category = $ category-> join_table('product');'。 – ryeguy 2010-04-09 19:21:27