简体   繁体   English

是否可以创建一个不引用数据库表的CakePHP模型?

[英]Is it possible to create a CakePHP model that doesn't refer to a table from the database?

I'm developing an API for C2DM to send push messages to Android devices. 我正在为C2DM开发一个API,以便向Android设备发送推送消息。 I have the API in PHP5 and I want to tranform it to CakePHP 2.0. 我在PHP5中有API,我想将它转换为CakePHP 2.0。

How can I create a model in CakePHP that doesn't refer to a table in the database? 如何在CakePHP中创建一个不引用数据库中的表的模型? Is it possible to create such a model and a controller to manage it? 是否可以创建这样的模型和控制器来管理它?

Or is there any existing code to do Cloud to Device Messaging (C2DM) in CakePHP? 或者是否有任何现有代码在CakePHP中执行云到设备消息传递(C2DM)?

Thanks in advance. 提前致谢。

您可以在该特定的无表格模型中将$useTable设置$useTable false有关详细信息请参阅该手册

cakephp模型有一个名为$ useTable的属性,您可以将其设置为false。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM