SQLBuilder\Universal\Query\InsertQuery::insert PHP Method

insert() public method

public insert ( array $values )
$values array
    public function insert(array $values)
    {
        $this->values[] = $values;
        return $this;
    }

Usage Example

Ejemplo n.º 1
0
 public function testInsertWithQuestionMark()
 {
     $driver = new MySQLDriver();
     $driver->setQMarkParamMarker();
     $args = new ArgumentArray();
     $query = new InsertQuery();
     $query->option('LOW_PRIORITY', 'IGNORE');
     $query->insert(['name' => new Bind('name', 'John'), 'confirmed' => new Bind('confirmed', true)])->into('users');
     $query->returning('id');
     $sql = $query->toSql($driver, $args);
     $this->assertEquals('INSERT LOW_PRIORITY IGNORE INTO users (name,confirmed) VALUES (?,?)', $sql);
 }
All Usage Examples Of SQLBuilder\Universal\Query\InsertQuery::insert