Phalcon PDO兴奋模型优先 [英] Phalcon pdo excpetion model first

查看:70
本文介绍了Phalcon PDO兴奋模型优先的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对phalcon框架有疑问,即模型方法有问题...

I have problem with phalcon framework namely with models methods...

您知道模型包含方法 find() findFirst()

As you know models has included methods find() and findFirst()

我已经使用phalcon-dev工具生成了模型,现在我正在尝试执行Model :: find,但是却遇到了异常,但不知道为什么...

I have generated model with phalcon-dev tools and now I am trying to do Model::find on it but I am getting an exception but dont know why...

还有更多信息(例如stacktrace):

There is some more informations (e.g stacktrace) :

http://exception.mateuszmarzecki.pl/

推荐答案

所以...经过一段时间的调试,我发现了问题...

So... after some time of debugging I've found the problem...

对于下一代……如果您不想像我一样失去一个星期.只需仔细阅读您的应用程序配置即可.

For the next generation... if you don't want to lose a week as I did. Just read carefully your application config.

出现问题是因为我也错过了表和列注释.

Problems occurs because I missed table and column annotations as well.

在我的应用程序配置中,我有类似的内容:

In my application config I have something like:

$metaData->setStrategy(new \Engine\Db\Model\Annotations\Metadata());

所以Phalcon在我的模型文件中寻找注释,有关此的更多信息,您可以在这里找到:

so Phalcon was looking for annotations in my model files, more info about this you can find there:

https://forum.phalconphp.com/discussion/1933年/模型注释的列类型

新年快乐

这篇关于Phalcon PDO兴奋模型优先的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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