1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-02 12:21:06 +02:00

added IDibiVariable

This commit is contained in:
David Grudl
2011-02-16 18:01:22 +01:00
parent b148291ca2
commit e37af6f99d
2 changed files with 14 additions and 0 deletions

View File

@@ -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) . '**';

View File

@@ -25,6 +25,17 @@ interface IDataSource extends Countable, IteratorAggregate
/**
* Object that is able to generate SQL.
* @package dibi
*/
interface IDibiVariable
{
function toSql();
}
/**