Ejemplo n.º 1
0
 /**
  * Factory Insert Builder
  *
  * @param  string $table the table to update
  * @return Insert
  */
 public static function insert($table = null)
 {
     $query = new Insert();
     if ($table) {
         $query->into($table);
     }
     return $query;
 }
Ejemplo n.º 2
0
 public function testResolvesSqlReplacingPlaceholders()
 {
     $this->object->into('table_name')->values(array('name' => ':name', 'age' => ':age'));
     $sql = 'INSERT INTO table_name (name, age) VALUES ("foo", 18)';
     $this->assertEquals($sql, $this->object->toSql(array('name' => 'foo', 'age' => 18)));
 }