CakePHP 名称约定问题

CakePHP Name convention Issue

Cakephp V. 2.5

我的数据库 table 名称是 group_key_persons,我的模型名称是 GroupKeyPerson,当我编写这段代码来获取数据时。

$this->loadModel ( 'GroupKeyPerson' );
$data = $this->GroupKeyPerson->find('all');
pr($data);

它return一个错误:

Missing Database Table

Error: Table group_key_people for model GroupKeyPerson was not found in datasource default.

但我很确定数据库 table 存在。但为什么人们来自我的 table。??

"person" 的复数形式是 "people" 而不是 "persons"。所以你的 table 名字应该 "group_key_people"