private function updateTeamConvert0($convert, $orig, $name, $type = TeamConvert::TYPE_AUTO) { if (!$convert) { $convert = TeamConvert::model()->findByPk($orig); if (!$convert) { $convert = new TeamConvert(); $convert->orig = $orig; } } if ($convert->name == $name) { return; } if ($name) { $convert->name = $name; $convert->type = $type; $convert->save(); } else { $convert->delete(); } }
public function actionDelete($orig) { TeamConvert::model()->deleteAllByAttributes(['orig' => $orig]); $this->renderJson(); }