Phalcon pdo excpetion model first

懵懂的女人 提交于 2019-12-24 23:00:05

问题


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

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

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...

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

http://exception.mateuszmarzecki.pl/


回答1:


You can try change methods in model file

public static function find($parameters = array())
{
    return self::find($parameters);
}



回答2:


Does not look like your passing it the right parms.

SELECT FROM `nacionality`

Notice that your not selecting any fields from the database, and that is why your getting the Exception.




回答3:


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());

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

https://forum.phalconphp.com/discussion/1933/column-types-for-model-annotations

Happy New Year



来源:https://stackoverflow.com/questions/34471840/phalcon-pdo-excpetion-model-first

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!