我有一个名为UserRecord
的模型,它与UserLimit
模型没有直接关系。
class UserRecord extends AppModel {
public function afterSave($created,$option=array()){
$id=$this->data['UserRecord']['id'];
$user_rec = $this->find('first', array('conditions' => array('UserRecord.id' => $id)));
$uid = $user_rec['UserRecord']['user_id'];
$UserLimit = ClassRegistry::init('UserLimit');
$user_limit = $UserLimit->find('first', array('conditions' => array('UserLimit.uid' => $uid)));
}
}
在find
中使用conditions
查询和CakePHP
的其他非关联模型是否正确?