【发布时间】:2015-10-08 12:32:04
【问题描述】:
这是我的表格关联代码:
class UserMastersTable extends Table {
public function initialize(array $config) {
parent::initialize($config);
$this->table('user_masters');
$this->hasOne('person_masters', [
'className' => 'person_masters',
'foreign_key'=>'user_master_id',
'dependent' => true
]);
}
}
当我在控制器中使用时: $this->UserMasters->get($id); 它只产生 user_masters 表数据.. 那么我怎样才能获得关联表数据呢?
【问题讨论】:
标签: mysql cakephp orm associations