开发者

Can we Change the default fieldname parent_id to FldParentId in Cake Php for Find('thread') statement?

I have changed the fieldname parent_id to FldParentId in a Table admin_menus. I want to select all the sub menus under a particular parent_id. but it gives an notice like

"Noti开发者_如何转开发ce (8): Undefined index: parent_id [CORE/cake/libs/model/model.php, line 2337]". So my question is that can I change this fieldname from parent_id to FldParentId.Is that possible..or I have to keep this fieldname as parent_id??

Please help me out..I need to know dat.. Thanks in advance.


Since there is no option to overwrite the key to use for the find('threaded') method you need to keep the fieldname like the way CakePHP wants it or you could overwrite the method used by CakePHP in your AppModel.

Seecake/libs/model/model.php on line 2311 where you can find the _findThreaded function to see how this is working.

I would just rename the field if you have no other dependencies on it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜