데이터베이스 및 ORM과 함께 Kohana v3을 사용하고 있습니다. Kohana 3.0.x ORM: Read additional columns in pivot tables추가 열이없는 Kohana 피벗 테이블
내가 추가 열이 2 피벗 테이블을 가지고 : 나는 나 추가 및 피벗 테이블에 추가 열을 읽을 수 있도록 멋진 질문을 발견했다. 그 중 하나가 완벽하게 작동하지만 나는 두 번째로 알려지지 않은 곳에 머물러 있습니다.
있어 2 표, 응용 프로그램 및 파트너 플러스 다음 ORM 모델 내 피벗 테이블 :
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()
);
}
내가
$instance = ORM::factory('partners_applications',array('partner_id' => $this->partner,'application_id' => $this->application))->find();
Kohana 말을 계속 얻으려고 :
ErrorException [ Fatal Error ]: Class 'Model_Partners_applications' not found
모델 이름 구성을 세 번 확인했지만 오류를 찾을 수 없습니다. Kohana 환경 디버그 파트에서 두 개의 firsts 모델이로드되지만 피벗 테이블은로드되지 않습니다.
아이디어가 있으십니까? Kohana ORM은 항상 단수형 기대에
나는 plurial 형태가 많은 관계로 많은 맞는 생각 코 하나. 어쨌든, 파트너 및/또는 응용 프로그램의 단수형에서 나에게 같은 오류가 발생합니다. – Pioup