private function refresh($identifier, $fields) { $model = StorageEffect::find()->where(['identifier' => $identifier])->one(); if ($model) { $model->setAttributes($fields, false); $model->update(false); } else { $this->addLog('effect "' . $identifier . '" added'); $insert = new StorageEffect(); $insert->identifier = $identifier; $insert->setAttributes($fields, false); $insert->insert(false); } }