我的正常数组是这样的
**阵列 ( [0] =>排列 ( [name] => companyadmin [type] => 2 [描述] => companyadmin [bizrule] => companyadmin [data] => N; [created_by] => 15 [trade_company_id] => 0 )
) **
我希望将其转换为yii对象数组。这个敞篷车怎么样?
答案 0 :(得分:0)
如果您想从数组
创建模型CActiveRecord::model('ClassName')->populateRecord($data).
或
$model = new ClassModel;
$model->attributes = $data;