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


PHP DibiConnection::delete方法代碼示例

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


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

示例1: deleteId

 /**
  * @param $id numeric
  *
  * @throws Exception
  */
 public function deleteId($id)
 {
     if (!is_numeric($id)) {
         throw new Exception('Wrong DELETE parameter: Non-numeric ID not allowed');
     }
     $this->database->delete($this->table)->where('id = ?', (int) $id)->execute();
 }
開發者ID:bombush,項目名稱:NatsuCon,代碼行數:12,代碼來源:EntityModel.php

示例2: deleteItem

 /**
  * @param object $instance
  * @param ClassMetadata $classMetadata
  * @return \DibiResult|int
  */
 private function deleteItem($instance, ClassMetadata $classMetadata)
 {
     $affectedRows = $this->dibiConnection->delete($classMetadata->getTable())->where($this->buildPrimaryKey($instance, $classMetadata))->execute(\dibi::AFFECTED_ROWS);
     $classKey = $this->getEntityClassHashKey($instance);
     unset($this->managedClasses[$classKey]);
     return $affectedRows;
 }
開發者ID:doublemcz,項目名稱:dibi-orm,代碼行數:12,代碼來源:Manager.php

示例3: createModifyManyToMany

 public function createModifyManyToMany(Association\ManyToMany $association, $primaryValue, array $refKeys, $action = self::ASSOC_ADD)
 {
     if ($action === self::ASSOC_ADD) {
         $fluent = $this->connection->insert($association->getJoinResource(), [$association->getJoinKey() => array_fill(0, count($refKeys), $primaryValue), $association->getReferencingKey() => $refKeys]);
     } else {
         $fluent = $this->connection->delete($association->getJoinResource())->where("%n = %s", $association->getJoinKey(), $primaryValue)->and("%n IN %l", $association->getReferencingKey(), $refKeys);
     }
     $query = new Query($fluent);
     $query->resultCallback = function (Query $query) {
         return $query->fluent->execute();
     };
     return $query;
 }
開發者ID:bauer01,項目名稱:unimapper-dibi,代碼行數:13,代碼來源:Adapter.php

示例4: remove

 /**
  * Remove authorization code
  * @param string $authorizationCode
  * @return void
  */
 public function remove($authorizationCode)
 {
     $this->context->delete($this->getTable())->where('authorization_code = %s', $authorizationCode)->execute();
 }
開發者ID:drahak,項目名稱:oauth2,代碼行數:9,代碼來源:AuthorizationCodeStorage.php

示例5: tearDown

 protected function tearDown()
 {
     $this->db->delete("pages")->execute();
     $this->db->delete("connections")->execute();
     $this->db->delete("tags")->execute();
 }
開發者ID:janmarek,項目名稱:Ormion,代碼行數:6,代碼來源:ManyToManyTest.php

示例6: delete

 public function delete($id)
 {
     return $this->connection->delete($this->table)->where('id=%i', $id)->execute();
 }
開發者ID:vrana,項目名稱:nette,代碼行數:4,代碼來源:Albums.php

示例7: delete

 /**
  * @param int $id
  * @return bool
  */
 public function delete($id)
 {
     $this->database->delete(self::TABLE)->where(self::TABLE . '.id = %i', $id)->execute();
     return $this->database->getAffectedRows() == 1;
 }
開發者ID:josiff,項目名稱:fri-sandbox,代碼行數:9,代碼來源:ArticleModel.php

示例8: remove

 /**
  * Remove refresh token
  * @param string $refreshToken
  */
 public function remove($refreshToken)
 {
     $this->context->delete($this->getTable())->where(array('refresh_token' => $refreshToken))->execute();
 }
開發者ID:drahak,項目名稱:oauth2,代碼行數:8,代碼來源:RefreshTokenStorage.php


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