protected function findModel($id) { if (($model = FilterVariant::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
public static function saveEdit($id, $name, $value) { $setting = FilterVariant::findOne($id); $setting->{$name} = $value; $setting->save(); }