/**
  * {@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());
 }
Exemplo n.º 2
0
 /**
  * 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);
         }
     }
 }
Exemplo n.º 3
0
 /**
  * {@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);
     }
 }
Exemplo n.º 4
0
 /**
  * {@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);
     }
 }
Exemplo n.º 5
0
 /**
  * {@inheritdoc}
  */
 public function delete()
 {
     $this->database->truncate('node_access')->execute();
 }
 /**
  * {@inheritdoc}
  */
 public function clear()
 {
     $this->db->truncate($this->table)->execute();
 }
 /**
  * {@inheritdoc}
  */
 public function purge()
 {
     $this->database->truncate('webprofiler')->execute();
 }
 /**
  * {@inheritdoc}
  */
 public function deleteAll()
 {
     $this->database->truncate('url_alias')->execute();
 }