/** * Returns the SQL for an insert statement * * @param \Opis\Database\SQL\InsertStatement $insert * * @return string */ public function insert(InsertStatement $insert) { $columns = $this->handleColumns($insert->getColumns()); $sql = 'INSERT INTO '; $sql .= $this->handleTables($insert->getTables()); $sql .= $columns === '*' ? '' : ' (' . $columns . ')'; $sql .= $this->handleInsertValues($insert->getValues()); return $sql; }
/** * @param string $table * * @return boolean */ public function into(string $table) { parent::into($table); $compiler = $this->connection->getCompiler(); return $this->connection->command($compiler->insert($this->sql), $compiler->getParams()); }
public function into($table) { parent::into($table); return $this->connection->command((string) $this, $this->compiler->getParams()); }