mirror of
https://github.com/dg/dibi.git
synced 2025-08-02 12:21:06 +02:00
added IDibiVariable
This commit is contained in:
@@ -439,6 +439,9 @@ final class DibiTranslator extends DibiObject
|
||||
} elseif ($value instanceof DateTime) {
|
||||
return $this->driver->escape($value, dibi::DATETIME);
|
||||
|
||||
} elseif ($value instanceof IDibiVariable) {
|
||||
return (string) $value->toSql();
|
||||
|
||||
} else {
|
||||
$this->hasError = TRUE;
|
||||
return '**Unexpected ' . gettype($value) . '**';
|
||||
|
@@ -25,6 +25,17 @@ interface IDataSource extends Countable, IteratorAggregate
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Object that is able to generate SQL.
|
||||
* @package dibi
|
||||
*/
|
||||
interface IDibiVariable
|
||||
{
|
||||
|
||||
function toSql();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user