
Representation of an unbuffered result from a query against the fDatabase class
1.0.0b13 | Added a workaround for iconv having issues in MAMP 1.9.4+ 7/26/11 |
---|---|
1.0.0b12 | Fixed MSSQL to have a properly reset row array, added silenceNotices(), fixed pdo_dblib on Windows when using the Microsoft DBLib driver 5/9/11 |
1.0.0b11 | Fixed some bugs with the mysqli extension and prepared statements 8/28/10 |
1.0.0b10 | Backwards Compatibility Break - removed ODBC support 7/31/10 |
1.0.0b9 | Added IBM DB2 support 4/13/10 |
1.0.0b8 | Added support for prepared statements 3/2/10 |
1.0.0b7 | Fixed a bug with decoding MSSQL national column when using an ODBC connection 9/18/09 |
1.0.0b6 | Added the method unescape(), changed tossIfNoRows() to return the object for chaining 8/12/09 |
1.0.0b5 | Added the method asObjects() to allow for returning objects instead of associative arrays 6/23/09 |
1.0.0b4 | Fixed a bug with not properly converting SQL Server text to UTF-8 6/18/09 |
1.0.0b3 | Added support for Oracle, various bug fixes 5/4/09 |
1.0.0b2 | Updated for new fCore API 2/16/09 |
1.0.0b | The initial implementation 5/7/08 |
Composes text using fText if loaded
string compose( string $message, mixed $component [, ... ] )
string | $message | The message to compose |
mixed | $component [, ... ] | A string or number to insert into the message |
The composed and possible translated message
Turns off notices about broken database extensions much as the MSSQL DBLib driver
void silenceNotices( )
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Configures the result set
fUnbufferedResult __construct( fDatabase $database, string $character_set=NULL )
fDatabase | $database | The database object this result was created from |
string | $character_set | MSSQL only: the character set to transcode from since MSSQL doesn't do UTF-8 |
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Frees up the result object
void __destruct( )
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
All requests that hit this method should be requests for callbacks
callback __get( string $method )
string | $method | The method to create a callback for |
The callback for the method requested
Sets the object to return rows as objects instead of associative arrays (the default)
fUnbufferedResult asObjects( )
The result object, to allow for method chaining
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Returns the current row in the result set (required by iterator interface)
array|stdClass current( )
The current row
Returns the row next row in the result set (where the pointer is currently assigned to)
array|stdClass fetchRow( )
The next row in the result
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Returns the result
mixed getResult( )
The result of the query
Returns the SQL used in the query
string getSQL( )
The SQL used in the query
Returns the SQL as it was before translation
string getUntranslatedSQL( )
The SQL from before translation
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Returns the current row number (required by iterator interface)
integer key( )
The current row number
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Advances to the next row in the result (required by iterator interface)
void next( )
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Rewinds the query (required by iterator interface)
void rewind( )
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Sets the result from the query
void setResult( mixed $result )
mixed | $result | The result from the query |
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Sets the SQL used in the query
void setSQL( string $sql )
string | $sql | The SQL used in the query |
Please note: this method is public, however it is primarily intended for internal use by Flourish and will normally not be useful in site/application code
Sets the SQL from before translation
void setUntranslatedSQL( string $untranslated_sql )
string | $untranslated_sql | The SQL from before translation |
Throws an fNoResultException if the query did not return any rows
fUnbufferedResult tossIfNoRows( string $message=NULL )
string | $message | The message to use for the exception if there are no rows in this result set |
The result object, to allow for method chaining
Sets the result object to unescape all values as they are retrieved from the object
The data types should be from the list of types supported by fDatabase::unescape().
fUnbufferedResult unescape( array $column_data_type_map )
array | $column_data_type_map | An associative array with column names as the keys and the data types as the values |
The result object, to allow for method chaining
Returns if the query has any rows left
boolean valid( )
If the iterator is still valid