Cakephp调用未定义的方法集:: numeric() [英] Cakephp Call to Undefined Method Set::numeric()

查看:46
本文介绍了Cakephp调用未定义的方法集:: numeric()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将PHP网站移植到cakePHP中,由于数据库表等中大量错误地命名列等原因,事实证明这有点困难。

I am attempting to port a PHP website into cakePHP which is proving somewhat difficult due to a ridiculous amount of incorrectly named columns in the database tables etc. etc.

不管怎么说,重命名很多东西之后,我已经走了大部分路,而且我可以烘烤整个网站而没有太多问题。然后,我可以正常浏览网站(烘焙版本),一切似乎都可以正常运行,但是有一个名为 sets的,并且似乎引起了问题。

Anywho, I've gotten most of the way there after renaming many things,and I can bake the entire site without much issue. I can then browse the site normally (the baked version) and everything seems to work on the face of things however there is a table called 'sets' and it seems to cause a problem.

此表名是否有特殊保留?尝试使用集合控制器时会出现问题,即:site / sets / index或site / sets / add将仅返回一个错误,指出未在控制器中定义它。
如果随后我继续访问任何其他控制器,则会遇到此错误:

Is there some special reservation for this table name? The issue comes when attempting to utilise the sets controller, ie: site/sets/index or site/sets/add will just return an error saying that it is not defined in the controller, it is. If I then proceed to access any of the other controllers I am met with this error:

Fatal error: Call to undefined method Set::numeric() in /pathtocake/lib/Cake/Model/Datasource/DboSource.php on line 2215

然后我通常必须重新启动Mamp才能继续!

I then usually have to restart mamp to continue!

有人能对此有所了解吗?
谢谢

Can anyone shed any light on this? Thanks

推荐答案

set / sets 是表和类的受保护名称。请参阅 http://groups.google.com/group/cake- php / msg / 8d149a246d46d3cf?pli = 1 http ://bakery.cakephp.org/articles/sajt/2007/02/25/cake-conventions

set/sets is a protected name for a table and a class. See http://groups.google.com/group/cake-php/msg/8d149a246d46d3cf?pli=1 and http://bakery.cakephp.org/articles/sajt/2007/02/25/cake-conventions

将表重命名为 mysets

您可以轻松地在 http://cakeapp.com 。此在线工具可帮助您正确命名表,并在找到受保护的名称时提供蛋糕的有效名称。

You can test your schema easily on http://cakeapp.com. This online tools helps you with naming tables correctly and offers cake valid names when a protected name was found.

这篇关于Cakephp调用未定义的方法集:: numeric()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆