Example #1
0
 public function action_delete($id = null)
 {
     if ($town = Model_Town::find($id)) {
         $town->delete();
         Session::set_flash('success', 'Deleted town #' . $id);
     } else {
         Session::set_flash('error', 'Could not delete town #' . $id);
     }
     Response::redirect('towns');
 }
Example #2
0
 private function get_next_search($last_search)
 {
     $town = \Model_Town::find()->where('id', '>', $last_search)->order_by('id', 'asc')->limit(1)->get_one();
     return $town;
 }