I'm using Kohana v3 with Database and ORM. I found a nice question which help me add and read additional columns in pivot tables: Kohana 3.0.x ORM: Read additional columns in pivot tables
I got 2 pivot table with additional column. One of those works perfectly but I'm stuck in the unknown with the second.
Got 2 tables, applications and partners plus my pivot table with the next ORM models:
class Model_Application extends ORM
{
protected $_has_many = array(
'partners'=>array(
'model'=>'partner',
'through'=>'partners_applications',
)
);
}
//AND
class Model_Partner extends ORM
{
protected $_has_many = array(
'applications' => array(
'model'=>'application',
'through'=>'partners_applications',
)
);
}
//plus my pivot table ORM model
class Model_Partners_applications extends ORM
{
protected $_belongs_to = array(
'partner' => array(),
'application' => array()
);
}
When I try to get
$instance = ORM::factory('partners_applications',array('partner_id' => $this->partner,'application_id' => $this->application))->find();
Kohana keep saying :
ErrorException [ Fatal Error ]: Class 'Model_Partners_applications' not found
I've triple checked Model name constructions but I can't find the error. In Kohana environment debug part, my two firsts models are loaded but not the pivot table.
Any ideas?