<?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);
            }
        }
    }
}