public function __construct($item = null, $config = [])
{
$this->_item = $item;
if ($item !== null) {
$this->name = $item->name;
$this->type = $item->type;
$this->description = $item->description;
$this->ruleName = $item->ruleName;
$this->data = $item->data === null ? null : Json::encode($item->data);
}
parent::__construct($config);
}