public function insert($table, array $data = null)
    {
        $insert = $this->build()->insert($table);
        if ($data) {
            return $insert->values($data)->execute();
        }

        return $insert;
    }
public function insert($table, array $data = null)
    {
        $insert = $this->build()->insert($table);
        if ($data) {
            return $insert->values($data)->execute();
        }

        return $insert;
    }
public function insert ( $ table , array $ data = null ) { $ insert = $ this -> build ( ) -> insert ( $ table ) ; if ( $ data ) { return $ insert -> values ( $ data ) -> execute ( ) ; } return $ insert ; }
Insert data into a table

When all parameters are specified, the insert query is immediately
executed and the number of rows affected will be returned. Otherwise
the query builder is returned so you can extend the query further.

@param string $table
@param array  $data (optional)
@return Query|int
@throws QueryException
Insert data into a table