コントローラーで醜い php スクリプトを実行せずに、次のケーキ php 結合をフォーマットする必要があります。
これが私のcakephpの参加です
$this->Type->find('all' , array(
'conditions' => array( 'Type.id' => '2' ),
'joins' => array(
array(
'table' => 'subtypes',
'alias' => 'Subtype',
'conditions' => 'Subtype.tid = Type.id'
)
)
));
そして、ここに私が得る出力があります
Array
(
[0] => Array
(
[Type] => Array
(
[id] => 4
[name] => Clay
[handle] => CL
[description] =>
)
[Subtype] => Array
(
[id] => 11
[tid] => 4
[name] => Water Based
)
)
[1] => Array
(
[Type] => Array
(
[id] => 4
[name] => Clay
[handle] => CL
[description] =>
)
[Subtype] => Array
(
[id] => 12
[tid] => 4
[name] => Oil Based
)
)
)
そして、ここに私が望む出力があります
Array
(
[0] => Array
(
[Type] => Array
(
[id] => 4
[name] => Clay
[handle] => CL
[description] =>
)
[Subtype] => Array(
[0] => Array(
[id] => 11
[tid] => 4
[name] => Water Based
)
[1] =>Array
(
[id] => 12
[tid] => 4
[name] => Oil Based
)
)
)
)
どうすればこれを達成できますか??
ありがとうございます^^