Ejemplo n.º 1
0
 /**
  * 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;
 }
Ejemplo n.º 2
0
 /**
  * @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());
 }
Ejemplo n.º 3
0
 public function into($table)
 {
     parent::into($table);
     return $this->connection->command((string) $this, $this->compiler->getParams());
 }