mirror of
https://github.com/dg/dibi.git
synced 2025-08-03 20:57:36 +02:00
added IDibiVariable
This commit is contained in:
@@ -439,6 +439,9 @@ final class DibiTranslator extends DibiObject
|
|||||||
} elseif ($value instanceof DateTime) {
|
} elseif ($value instanceof DateTime) {
|
||||||
return $this->driver->escape($value, dibi::DATETIME);
|
return $this->driver->escape($value, dibi::DATETIME);
|
||||||
|
|
||||||
|
} elseif ($value instanceof IDibiVariable) {
|
||||||
|
return (string) $value->toSql();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$this->hasError = TRUE;
|
$this->hasError = TRUE;
|
||||||
return '**Unexpected ' . gettype($value) . '**';
|
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