ケーキのモデルアーキテクチャに問題がありました。
Users-ModelとMetas-Modelを取得しました。モデルコードは次のとおりです。
ユーザー:
<?php
class User extends AppModel {
var $name = 'User';
var $validate = array(
'username' => array('notempty'),
'email' => array('email'),
'password' => array('notempty')
);
var $displayField = 'username';
var $hasMany = array(
'Meta' => array(
'className' => 'Meta',
'foreignKey' => 'user_id'
)
);
}
?>
およびメタモデル:
<?php
class Meta extends AppModel {
var $name = 'Meta';
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
'User' => array(
'className' => 'User',
'foreignKey' => 'user_id',
'required' => true
)
);
}
?>
では、なぜメタデータをユーザー配列に取得しないのかという問題があります。Authオブジェクトで取得する必要がありますか?
または、メタデータをどこで操作できますか?