Esempio n. 1
0
 public function save($validation = false, $attributes = [])
 {
     SettingsRecord::deleteAll(['categoryAlias' => $this->category]);
     foreach ($this->fields() as $key) {
         $model = new SettingsRecord();
         $model->categoryAlias = $this->category;
         $model->alias = $key;
         $model->content = $this->{$key};
         $model->save();
     }
     return true;
 }