<?php 
namespace PortalPeople\qvc\models;

use yii;

class Cartlines extends \backend\models\Cartlines
{
    public function rules() : array
    {
        $rules = parent::rules();
        $rules[] = [['data'], 'safe'];
        return $rules;
    }

    public function afterSave($insert, $changedAttributes)
    {
        parent::afterSave($insert, $changedAttributes);
        return true;
    }

    public function beforeSave($insert)
    {
        $this->data = json_encode($this->data);
        return parent::beforeSave($insert);
    }
}