示例#1
0
 /**
  * @param       $table
  * @param array $values
  *
  * @return Insert
  */
 public function insert($table, array $values = null)
 {
     $builder = new Insert($this->driver);
     $this->lastQuery = $builder;
     if ($values) {
         $builder->values($values);
     }
     return $builder->into($table);
 }
示例#2
0
 public function testInsertWithNamedParameters()
 {
     $insert = new Insert($this->driver);
     $insert->into('table')->values(['a' => $insert->createNamedParameter('foo'), 'b' => $insert->createNamedParameter('bar')]);
     $this->assertEquals('INSERT INTO table (a, b) VALUES (:parameter0, :parameter1)', $insert->get());
 }