cakePHPの検索でorderByについてただ1つの質問。私はお互いに関連した3つのモデルを持っているとしましょう。私の3つのモデルのいずれかでfind('all')
cakePHPクエリを実行すると、他の2つのモデルのデータも含まれた結果が得られます。私の3つのモデルが一緒にリンクされているので、私はこのような何かを得るでしょう、cakephp関連の他のモデルフィールドで注文
1- User
2- School
3- Country
私はUsersController
内$this->find('all')
を行う場合:たとえば、のは私のモデルがあるとしましょう
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
created
フィールドのモデルをたとえばSchool
としましょうか?
それがすべて
あなたはユーザーからのすべての関連データを取得しようとしている場合は、あなたの学校を