<?php
namespace modules\activities\models\Customs;
use yii;
use common\models\DynamicModel;

class Administration extends DynamicModel{

    public static function localAttributes(){
        return [
            'notes' => [
                'rules' => [['string']],
                'label' => 'Notes',
            ],
        ];
    }
    public static function afterLoad($data){
        $Model = new self();
        $jdata = is_array($data->data) ? $data->data : json_decode($data->data, true);
        if (!empty($jdata) && (array_key_exists('Administration', $jdata))) {
            $Model->load($jdata['Administration'], '');
        } 
        return $Model;
    }
}
