Cakephp find threaded parent_id - another name

I want to use the CakePHP method Model::find('threaded'), but in my MySQL table the parent key field father, and not parent_id- can I use it instead of this field name?

+3
source share
1 answer

In 2.1, you can pass an option parent; you may need the tree behavior applied to work.

Prior to version 2.1, you can simply use virtual fields in your model:

public $virtualFields = array(
    'parent_id' => 'Model.father'
);
+4
source

All Articles