public function action_delete($id = null) { if ($selfgeneration = Model_Selfgeneration::find($id)) { $selfgeneration->delete(); Session::set_flash('success', 'Deleted selfgeneration #' . $id); } else { Session::set_flash('error', 'Could not delete selfgeneration #' . $id); } Response::redirect('selfgeneration'); }
private function is_dupe($firstname, $telephone) { $check = \Model_Selfgeneration::find()->where('telephone', $telephone)->where('fname', $firstname); return $check->count() > 0 ? true : false; }