我之间有多对多的关系Profesional
,Plan
所以我编写了以下代码:
专业的.php
class Profesional extends BaseModel {
static $table_name = 'profesionales';
static $primary_key = 'idprofesional';
static $has_many = array(
array(
'_planes',
'class_name' => 'Plan',
'through' => '_profplanes'
),
array(
'_profplanes',
'class_name' => 'ProfPlan',
'foreign_key' => 'profesional'
)
);
}
profplan.php
class ProfPlan extends BaseModel{
static $table_name = 'profplanes';
static $belongs_to = array(
array(
'_plan',
'class_name' => 'Plan',
'foreign_key' => 'plan'
),
array(
'_profesional',
'class_name' => 'Profesional',
'foreign_key' => 'profesional'
)
);
}
计划.php
class Plan extends BaseModel {
static $table_name = 'planes';
static $primary_key = 'idplan';
static $has_many = array(
array(
'_profplanes',
'class_name' => 'ProfPlan',
'foreign_key' => 'plan'
)
);
}
但我明白了Class Profplane does not exist
。错误在哪里?我究竟做错了什么?