class Delete

Same name in this branch

SQLite specific implementation of DeleteQuery.

When the WHERE is omitted from a DELETE statement and the table being deleted has no triggers, SQLite uses an optimization to erase the entire table content without having to visit each row of the table individually.

Prior to SQLite 3.6.5, SQLite does not return the actual number of rows deleted by that optimized "truncate" optimization.

Hierarchy

Expanded class hierarchy of Delete

108 string references to 'Delete'
ActionListController::getOperations in drupal/core/modules/action/lib/Drupal/action/ActionListController.php
Overrides \Drupal\Core\Entity\EntityListController::getOperations();
AdminBlockDeleteForm::getConfirmText in drupal/core/modules/block/lib/Drupal/block/Form/AdminBlockDeleteForm.php
Returns a caption for the button that confirms the action.
AggregatorController::adminOverview in drupal/core/modules/aggregator/lib/Drupal/aggregator/Controller/AggregatorController.php
Displays the aggregator administration page.
AggregatorTestBase::deleteFeed in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php
Deletes an aggregator feed.
aggregator_form_category in drupal/core/modules/aggregator/aggregator.admin.inc
Form constructor to add/edit/delete aggregator categories.

... See full list

File

drupal/core/lib/Drupal/Core/Database/Driver/sqlite/Delete.php, line 22
Definition of Drupal\Core\Database\Driver\sqlite\Delete

Namespace

Drupal\Core\Database\Driver\sqlite
View source
class Delete extends QueryDelete {
  public function execute() {
    if (!count($this->condition)) {
      $total_rows = $this->connection
        ->query('SELECT COUNT(*) FROM {' . $this->connection
        ->escapeTable($this->table) . '}')
        ->fetchField();
      parent::execute();
      return $total_rows;
    }
    else {
      return parent::execute();
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Delete::$condition protected property The condition object for this query.
Delete::$table protected property The table from which to delete.
Delete::arguments public function Implements Drupal\Core\Database\Query\ConditionInterface::arguments(). Overrides ConditionInterface::arguments
Delete::compile public function Implements Drupal\Core\Database\Query\ConditionInterface::compile(). Overrides ConditionInterface::compile
Delete::compiled public function Implements Drupal\Core\Database\Query\ConditionInterface::compiled(). Overrides ConditionInterface::compiled
Delete::condition public function Implements Drupal\Core\Database\Query\ConditionInterface::condition(). Overrides ConditionInterface::condition
Delete::conditions public function Implements Drupal\Core\Database\Query\ConditionInterface::conditions(). Overrides ConditionInterface::conditions
Delete::execute public function Executes the DELETE query. Overrides Delete::execute
Delete::exists public function Implements Drupal\Core\Database\Query\ConditionInterface::exists(). Overrides ConditionInterface::exists
Delete::isNotNull public function Implements Drupal\Core\Database\Query\ConditionInterface::isNotNull(). Overrides ConditionInterface::isNotNull
Delete::isNull public function Implements Drupal\Core\Database\Query\ConditionInterface::isNull(). Overrides ConditionInterface::isNull
Delete::notExists public function Implements Drupal\Core\Database\Query\ConditionInterface::notExists(). Overrides ConditionInterface::notExists
Delete::where public function Implements Drupal\Core\Database\Query\ConditionInterface::where(). Overrides ConditionInterface::where
Delete::__construct public function Constructs a Delete object. Overrides Query::__construct
Delete::__toString public function Implements PHP magic __toString method to convert the query to a string. Overrides Query::__toString
Query::$comments protected property An array of comments that can be prepended to a query.
Query::$connection protected property The connection object on which to run this query.
Query::$connectionKey protected property The key of the connection object.
Query::$connectionTarget protected property The target of the connection object.
Query::$nextPlaceholder protected property The placeholder counter.
Query::$queryOptions protected property The query options to pass on to the connection object.
Query::$uniqueIdentifier protected property A unique identifier for this query object.
Query::comment public function Adds a comment to the query.
Query::getComments public function Returns a reference to the comments array for the query.
Query::nextPlaceholder public function Gets the next placeholder value for this query object. Overrides PlaceholderInterface::nextPlaceholder
Query::uniqueIdentifier public function Returns a unique identifier for this object. Overrides PlaceholderInterface::uniqueIdentifier
Query::__clone public function Implements the magic __clone function. 1
Query::__sleep public function Implements the magic __sleep function to disconnect from the database.
Query::__wakeup public function Implements the magic __wakeup function to reconnect to the database.