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


PHP DatabaseConnection::delete方法代碼示例

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


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

示例1: delete

 /**
  * {@inheritdoc}
  */
 public function delete($conditions)
 {
     if (!$conditions) {
         return;
     }
     $path = $this->load($conditions);
     $query = $this->db->delete('url_alias');
     foreach ($conditions as $field => $value) {
         if ($field == 'source' || $field == 'alias') {
             // Use LIKE for case-insensitive matching (still stupid).
             $query->condition($field, $this->db->escapeLike($value), 'LIKE');
         } else {
             if ('langcode' === $field) {
                 // Drupal 7 compat
                 $field = 'language';
             }
             $query->condition($field, $value);
         }
     }
     $deleted = $query->execute();
     // @todo Switch to using an event for this instead of a hook.
     $this->moduleHandler->invokeAll('path_delete', [$path]);
     \Drupal::service('path.alias_manager')->cacheClear();
     return $deleted;
 }
開發者ID:makinacorpus,項目名稱:drupal-sf-dic,代碼行數:28,代碼來源:DefaultAliasStorage.php

示例2: delete

 /**
  * {@inheritdoc}
  */
 public function delete($name)
 {
     $existing = null;
     if ($this->dispatcher) {
         try {
             $existing = $this->load($name);
         } catch (\InvalidArgumentException $e) {
         }
     }
     $this->db->delete('umenu')->condition('name', $name)->execute();
     if ($this->dispatcher && $existing) {
         $this->dispatcher->dispatch('menu:delete', new GenericEvent($existing));
     }
 }
開發者ID:makinacorpus,項目名稱:drupal-umenu,代碼行數:17,代碼來源:DrupalMenuStorage.php

示例3: delete

 public function delete($table, array $options = array())
 {
     return $this->connection->delete($table, $options);
 }
開發者ID:akapivo,項目名稱:www.dmi.be,代碼行數:4,代碼來源:Connection.php

示例4: delete

 /**
  * @see DatabaseConnection::delete
  */
 public function delete($where = '', $whereArgs = null, $limit = null)
 {
     return $this->dbc->delete($this->tblname, $where, $whereArgs, $limit);
 }
開發者ID:tniessen,項目名稱:tinyIt,代碼行數:7,代碼來源:TableAdapter.php


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