예제 #1
0
 public static function delete4foreign_table_and_foreign_ids($foreign_table, $foreign_ids)
 {
     $objs = self::get4foreign_table_and_foreign_ids($foreign_table, $foreign_ids);
     foreach ($objs as $obj) {
         Site_Model::delete_timeline($obj, $obj->member_id);
     }
 }
예제 #2
0
 /**
  * Timeline delete
  * 
  * @access  public
  * @params  integer
  * @return  Response
  */
 public function action_delete($id = null)
 {
     try {
         \Util_security::check_method('POST');
         \Util_security::check_csrf();
         if (\Input::post('id')) {
             $id = (int) \Input::post('id');
         }
         \DB::start_transaction();
         $timeline = Model_Timeline::check_authority($id, $this->u->id);
         Site_Model::delete_timeline($timeline, $this->u->id);
         \DB::commit_transaction();
         \Session::set_flash('message', term('timeline') . 'を削除しました。');
         \Response::redirect('timeline/member');
     } catch (\FuelException $e) {
         if (\DB::in_transaction()) {
             \DB::rollback_transaction();
         }
         \Session::set_flash('error', $e->getMessage());
     }
     \Response::redirect('timeline/' . $id);
 }