當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Manager::delete方法代碼示例

本文整理匯總了PHP中Illuminate\Database\Capsule\Manager::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP Manager::delete方法的具體用法?PHP Manager::delete怎麽用?PHP Manager::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Database\Capsule\Manager的用法示例。


在下文中一共展示了Manager::delete方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setBonusAttribute

 public function setBonusAttribute($value)
 {
     DB::delete('delete from t_event_bonuses where event_id = ? and player_id = ?', [$this->event->id, $this->player->id]);
     if ($value && $value != 'null') {
         DB::insert('insert into t_event_bonuses (event_id, player_id, bonus_id) values (?, ?, ?)', [$this->event->id, $this->player->id, $value]);
     }
 }
開發者ID:MadeByGlutard,項目名稱:GreenMountainGaming.com,代碼行數:7,代碼來源:Score.php

示例2: testRawQueries

 public function testRawQueries()
 {
     // Insert
     $inserted = Capsule::insert('INSERT INTO articles (title) VALUES (:title)', ['title' => static::ARTICLE_TITLE]);
     $this->assertTrue($inserted);
     // Last Insert ID
     $id = Capsule::connection()->getPdo()->lastInsertId();
     $this->assertEquals(1, $id);
     // Select
     $articles = Capsule::select('SELECT * FROM articles WHERE id = ?', [$id]);
     $this->assertCount(1, $articles);
     $this->assertEquals($articles[0]->title, static::ARTICLE_TITLE);
     // Delete
     $deleted = Capsule::delete('DELETE FROM articles WHERE id = ?', [$id]);
     $this->assertEquals(1, $deleted);
     // Count
     $count = Capsule::selectOne('SELECT COUNT(*) as nb FROM articles');
     $this->assertEquals(0, $count->nb);
 }
開發者ID:jguyomard,項目名稱:silex-capsule-eloquent,代碼行數:19,代碼來源:CapsuleServiceProviderTest.php

示例3: join

 /**
  * Join guild
  *
  * @return void
  */
 public function join(Character $player, $gid)
 {
     Capsule::delete('DELETE FROM `guild_invites` WHERE `player_id` = ?', [$player->id]);
     $rank = app('capsule')->table('guild_ranks')->where(function ($query) use($gid) {
         $query->where('guild_id', $gid);
         $query->where('level', 1);
     })->first();
     $new_member = new GuildMember();
     $new_member->player_id = $player->id;
     $new_member->guild_id = $gid;
     $new_member->rank_id = $rank->id;
     $new_member->nick = '';
     $new_member->save();
 }
開發者ID:Codex-NG,項目名稱:cornexaac,代碼行數:19,代碼來源:Guild.php


注:本文中的Illuminate\Database\Capsule\Manager::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。