/**
  * @return bool
  */
 public function beforeDelete()
 {
     if ($this->is_default) {
         return false;
     }
     return parent::beforeDelete();
 }
 /**
  * Перед сохранением
  * @param bool $insert
  * @return bool
  */
 public function beforeSave($insert)
 {
     $this->_autoIncrementPosition();
     if (is_array($this->variants)) {
         $this->variants = Json::encode($this->variants);
     }
     if (is_array($this->rules)) {
         $this->rules = Json::encode($this->rules);
     }
     return parent::beforeSave($insert);
 }