当前位置: 首页>>代码示例>>PHP>>正文


PHP Connection::truncate方法代码示例

本文整理汇总了PHP中Drupal\Core\Database\Connection::truncate方法的典型用法代码示例。如果您正苦于以下问题:PHP Connection::truncate方法的具体用法?PHP Connection::truncate怎么用?PHP Connection::truncate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Drupal\Core\Database\Connection的用法示例。


在下文中一共展示了Connection::truncate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $_SESSION['dblog_overview_filter'] = array();
     $this->connection->truncate('watchdog')->execute();
     drupal_set_message($this->t('Database log cleared.'));
     $form_state->setRedirectUrl($this->getCancelUrl());
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:10,代码来源:DblogClearLogConfirmForm.php

示例2: deleteAll

 /**
  * Implements Drupal\Core\Cache\CacheBackendInterface::deleteAll().
  */
 public function deleteAll()
 {
     try {
         $this->connection->truncate($this->bin)->execute();
     } catch (\Exception $e) {
         // Create the cache table, which will be empty. This fixes cases during
         // core install where a cache table is cleared before it is set
         // with {cache_render} and {cache_data}.
         if (!$this->ensureBinExists()) {
             $this->catchException($e);
         }
     }
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:16,代码来源:DatabaseBackend.php

示例3: deleteAllIndexItems

 /**
  * {@inheritdoc}
  */
 public function deleteAllIndexItems(IndexInterface $index)
 {
     try {
         foreach ($this->configuration['field_tables'][$index->id()] as $field) {
             $this->database->truncate($field['table'])->execute();
         }
         $this->database->truncate($this->configuration['index_tables'][$index->id()])->execute();
     } catch (\Exception $e) {
         // The database operations might throw PDO or other exceptions, so we catch
         // them all and re-wrap them appropriately.
         throw new SearchApiException($e->getMessage(), $e->getCode(), $e);
     }
 }
开发者ID:alexku,项目名称:travisintegrationtest,代码行数:16,代码来源:Database.php

示例4: deleteAllIndexItems

 /**
  * {@inheritdoc}
  */
 public function deleteAllIndexItems(IndexInterface $index)
 {
     try {
         $db_info = $this->getIndexDbInfo($index);
         foreach ($db_info['field_tables'] as $field) {
             $this->database->truncate($field['table'])->execute();
         }
         $this->database->truncate($db_info['index_table'])->execute();
     } catch (\Exception $e) {
         // The database operations might throw PDO or other exceptions, so we
         // catch them all and re-wrap them appropriately.
         throw new SearchApiException($e->getMessage(), $e->getCode(), $e);
     }
 }
开发者ID:curveagency,项目名称:intranet,代码行数:17,代码来源:Database.php

示例5: delete

 /**
  * {@inheritdoc}
  */
 public function delete()
 {
     $this->database->truncate('node_access')->execute();
 }
开发者ID:brstde,项目名称:gap1,代码行数:7,代码来源:NodeGrantDatabaseStorage.php

示例6: clear

 /**
  * {@inheritdoc}
  */
 public function clear()
 {
     $this->db->truncate($this->table)->execute();
 }
开发者ID:nishantkumar155,项目名称:drupal8.crackle,代码行数:7,代码来源:IndexerBase.php

示例7: purge

 /**
  * {@inheritdoc}
  */
 public function purge()
 {
     $this->database->truncate('webprofiler')->execute();
 }
开发者ID:ABaldwinHunter,项目名称:durhamatletico-cms,代码行数:7,代码来源:DatabaseProfilerStorage.php

示例8: deleteAll

 /**
  * {@inheritdoc}
  */
 public function deleteAll()
 {
     $this->database->truncate('url_alias')->execute();
 }
开发者ID:eric-shell,项目名称:eric-shell-d8,代码行数:7,代码来源:AliasStorageHelper.php


注:本文中的Drupal\Core\Database\Connection::truncate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。