Doctrine record unknown exception in a Symfony 1.4

2019-09-09 04:26发布

I am facing a problem with the admin generator and I am unable to get my way around this after 3 hours of brainstorming and exploring.

The error reads as:

500 | Internal Server Error | Doctrine_Record_UnknownPropertyException Unknown record property / related component "option1" on "Questions"

Looking up the WWW, I got a gist of possible alternatives. None of which seem like the answer. option1, does exist under Questions schema. However, it is option_1 so I am not sure why it says option1. More importantly, opening up BaseQuestions.class.php file, it clearly states:

getOption1() retrieves the value of option_1.

Anybody with any answer on this?

Thanks,

1条回答
三岁会撩人
2楼-- · 2019-09-09 04:58

I had just the same problem with a field named address_2. Changing the name of the field in the database to address2 solved the problem. I think that that this is because of the number that confuse the admin generator to translate the name from underscore-separated propriety name to camelCase function name. This issue append only with the admin generator so, if you need to use it you have to change the field name in your DB with option1.

查看更多
登录 后发表回答