8.4.x Connection.php public Connection::insert($table, array $options = [])
8.0.x Connection.php public Connection::insert($table, array $options = array())
8.1.x Connection.php public Connection::insert($table, array $options = array())
8.2.x Connection.php public Connection::insert($table, array $options = array())
8.3.x Connection.php public Connection::insert($table, array $options = [])
8.5.x Connection.php Connection::insert($table, array $options = [])

Prepares and returns an INSERT query object.

Parameters

string $table: The table to use for the insert statement.

array $options: (optional) An array of options on the query.

Return value

\Drupal\Core\Database\Query\Insert A new Insert query object.

See also

\Drupal\Core\Database\Query\Insert

File

core/lib/Drupal/Core/Database/Connection.php, line 803

Class

Connection
Base Database API class.

Namespace

Drupal\Core\Database

Code

public function insert($table, array $options = array()) {
  $class = $this->getDriverClass('Insert');
  return new $class($this, $table, $options);
}