Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想使用 CakePHP 的Model::find('threaded')方法,但在我的 MySQL 表中,父键字段是father而不是parent_id- 是否可以将它与此字段名称一起使用?
Model::find('threaded')
father
parent_id
在 2.1 上,您可以传递 option parent,您可能需要附加树行为才能使其工作。
parent
在 2.1 之前,您可以在模型中使用虚拟字段:
public $virtualFields = array( 'parent_id' => 'Model.father' );