1
只是一个大约的OrderBy快速的问题CakePHP中找到操作。假设我有3个模型相互关联。当我做任何我的3种型号的find('all')
CakePHP的查询,我得到的结果还包括来自其他2款机型的数据。例如,假设我的车型有:CakePHP的顺序由另一个模型字段关联
1- User
2- School
3- Country
如果我做$this->find('all')
内UsersController
,因为我的三个型号都连在一起,我会得到这样的:
Array
(
[0] => Array
(
[User] => Array
(
[id] => 'the_auto_incrementing_id'
// other table columns
[created] 'creation_date'
[modified] 'modification_date'
)
[School] => Array
(
[id] => 'the_auto_incrementing_id'
// other table columns
[created] 'creation_date'
[modified] 'modification_date'
)
[Country] => Array
(
[id] => 'the_auto_incrementing_id'
// other table columns
[created] 'creation_date'
[modified] 'modification_date'
)
)
)
我的问题是,虽然我find('all')
查询是在User
模型发起的,是有可能orderBy
假设模型School
例如created
场?
请让我知道这是不可能的
谢谢