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

returning() public method

public returning ( $returningColumns )
    public function returning($returningColumns)
    {
        if (is_array($returningColumns)) {
            $this->returning = $returningColumns;
        } else {
            $this->returning = func_get_args();
        }
        return $this;
    }

Usage Example

Example #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::returning