1234567891011121314151617181920212223 |
- <?php
- namespace common\util;
- use yii\db\ActiveRecord;
- class SqlHelper
- {
- /**
- * @param $paramData
- * @param ActiveRecord $model
- */
- public static function setAttributeFromParamData(ActiveRecord $model, $paramData)
- {
- foreach ($paramData as $key => $value) {
- if ($model->hasAttribute($key)) {
- $model->setAttribute($key, $value);
- }
- }
- }
- }
|