I’m using the “join_table” 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
$categoryto the return value ofjoin_tablelike you are in the first one. Could that be your problem?