CakePHP 2.0 - 没有底层数据库表的插件模型
我在使用与底层数据库表不关联的模型创建 Cake 2.0 插件时遇到困难。
蛋糕手册说你可以设置变量 public $useTable = false; 但是当我在模型中加载带有此变量的插件时,我仍然收到丢失数据库表的错误消息。
这是我的类定义的开始(我的插件称为 OneTime):
class Ticket extends OneTimeAppModel {
/*
* This model does not use a database table
*
* @var boolean
*/
public $useTable = FALSE;
我在这里做错了什么?
I'm having difficulty in creating a Cake 2.0 plugin with a model that is not associated with an underlying database table.
The Cake Manual says that you can set the variable public $useTable = false; but when I load my plugin with this in my model I still get the missing database table error message.
This is the beginning of my class definition (where my plugin is called OneTime):
class Ticket extends OneTimeAppModel {
/*
* This model does not use a database table
*
* @var boolean
*/
public $useTable = FALSE;
What am I doing wrong here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
同时,为了解决方法,我一直在使用:
public $uses = array();
For a workaround in the meanwhile, I've been using this:
public $uses = array();