public function createDiff($model, $modelForm, $previousModel, $auditId)
    {
        if ($previousModel) {
            $diff = array_diff_assoc($model, $previousModel);
        } else {
            // if dataProvider doesn't have previous element we should select it directly from table
            // in condition if this is for example new page.
            $prev = $this->getPrevious($modelForm, $auditId);
            if (!empty($prev)) {
                $diff = array_diff_assoc($model, $prev);
            } else {
                $diff = $model;
            }
        }
        $arrayDiff = implode('; ', array_map(
            function ($v, $k) {
                return $k . '=' . $v;
            },
            $diff,
            $this->getColumnsLabel(array_keys($diff), $modelForm->table)
        ));
        return $arrayDiff;
    }
public function createDiff($model, $modelForm, $previousModel, $auditId)
    {
        if ($previousModel) {
            $diff = array_diff_assoc($model, $previousModel);
        } else {
            // if dataProvider doesn't have previous element we should select it directly from table
            // in condition if this is for example new page.
            $prev = $this->getPrevious($modelForm, $auditId);
            if (!empty($prev)) {
                $diff = array_diff_assoc($model, $prev);
            } else {
                $diff = $model;
            }
        }
        $arrayDiff = implode('; ', array_map(
            function ($v, $k) {
                return $k . '=' . $v;
            },
            $diff,
            $this->getColumnsLabel(array_keys($diff), $modelForm->table)
        ));
        return $arrayDiff;
    }
public function createDiff ( $ model , $ modelForm , $ previousModel , $ auditId ) { if ( $ previousModel ) { $ diff = array_diff_assoc ( $ model , $ previousModel ) ; } else { // if dataProvider doesn't have previous element we should select it directly from table // in condition if this is for example new page. $ prev = $ this -> getPrevious ( $ modelForm , $ auditId ) ; if ( ! empty ( $ prev ) ) { $ diff = array_diff_assoc ( $ model , $ prev ) ; } else { $ diff = $ model ; } } $ arrayDiff = implode ( '; ' , array_map ( function ( $ v , $ k ) { return $ k . '=' . $ v ; } , $ diff , $ this -> getColumnsLabel ( array_keys ( $ diff ) , $ modelForm -> table ) ) ) ; return $ arrayDiff ; }
Gets differences between current and previous dataProvider element

@param array $model
@param \yii\base\Model $modelForm
@param array $previousModel
@param integer $auditId
@return string
Gets differences between current and previous dataProvider element