table user:
|id|name|employee_priority_id|user_priority_id|
table priority:
|id|name|
As you can see, there are two foreign fields to the same table. But Kohana ORM default looks for a field called priority_id, which doesn’t exist.
Is there a way to let Kohana ORM know that those two fields are an foreign key to that table.
You can use ‘aliasing’ as documented @ http://docs.kohanaphp.com/libraries/orm/advanced#aliasingenhancing_the_meaning_of_your_relationships
So in your case, your User_Model would be:
BTW, according to Kohana’s convention table names ought to be in plural form unless you override the $table_name, e.g: