Executes the insert query.
The last insert ID of the query, if one exists. If the query was given multiple sets of values to insert, the return value is undefined. If no fields are specified, this method will do nothing and return NULL. That makes it safe to use in multi-insert loops.
Overrides Insert::execute
public function execute() {
if (!$this
->preExecute()) {
return NULL;
}
if (count($this->insertFields)) {
return parent::execute();
}
else {
return $this->connection
->query('INSERT INTO {' . $this->table . '} DEFAULT VALUES', array(), $this->queryOptions);
}
}