function Insert::execute

Same name in this branch
  1. 8.9.x core/lib/Drupal/Core/Database/Driver/mysql/Insert.php \Drupal\Core\Database\Driver\mysql\Insert::execute()
  2. 8.9.x core/lib/Drupal/Core/Database/Driver/pgsql/Insert.php \Drupal\Core\Database\Driver\pgsql\Insert::execute()
  3. 8.9.x core/lib/Drupal/Core/Database/Query/Insert.php \Drupal\Core\Database\Query\Insert::execute()
Same name in other branches
  1. 9 core/modules/sqlite/src/Driver/Database/sqlite/Insert.php \Drupal\sqlite\Driver\Database\sqlite\Insert::execute()
  2. 9 core/modules/mysql/src/Driver/Database/mysql/Insert.php \Drupal\mysql\Driver\Database\mysql\Insert::execute()
  3. 9 core/modules/pgsql/src/Driver/Database/pgsql/Insert.php \Drupal\pgsql\Driver\Database\pgsql\Insert::execute()
  4. 9 core/lib/Drupal/Core/Database/Query/Insert.php \Drupal\Core\Database\Query\Insert::execute()
  5. 10 core/modules/sqlite/src/Driver/Database/sqlite/Insert.php \Drupal\sqlite\Driver\Database\sqlite\Insert::execute()
  6. 10 core/modules/mysql/src/Driver/Database/mysql/Insert.php \Drupal\mysql\Driver\Database\mysql\Insert::execute()
  7. 10 core/modules/pgsql/src/Driver/Database/pgsql/Insert.php \Drupal\pgsql\Driver\Database\pgsql\Insert::execute()
  8. 10 core/lib/Drupal/Core/Database/Query/Insert.php \Drupal\Core\Database\Query\Insert::execute()
  9. 11.x core/modules/sqlite/src/Driver/Database/sqlite/Insert.php \Drupal\sqlite\Driver\Database\sqlite\Insert::execute()
  10. 11.x core/modules/mysql/src/Driver/Database/mysql/Insert.php \Drupal\mysql\Driver\Database\mysql\Insert::execute()
  11. 11.x core/modules/pgsql/src/Driver/Database/pgsql/Insert.php \Drupal\pgsql\Driver\Database\pgsql\Insert::execute()
  12. 11.x core/lib/Drupal/Core/Database/Query/Insert.php \Drupal\Core\Database\Query\Insert::execute()

Overrides Insert::execute

File

core/lib/Drupal/Core/Database/Driver/sqlite/Insert.php, line 16

Class

Insert
SQLite implementation of \Drupal\Core\Database\Query\Insert.

Namespace

Drupal\Core\Database\Driver\sqlite

Code

public function execute() {
    if (!$this->preExecute()) {
        return NULL;
    }
    if (count($this->insertFields) || !empty($this->fromQuery)) {
        return parent::execute();
    }
    else {
        return $this->connection
            ->query('INSERT INTO {' . $this->table . '} DEFAULT VALUES', [], $this->queryOptions);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.