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

DibiTranslator: supported key%~like~ modifier in array keys

This commit is contained in:
David Grudl
2012-01-19 05:36:45 +01:00
parent 5aed9e7e4f
commit 3cde2c7815

View File

@@ -218,7 +218,16 @@ final class DibiTranslator extends DibiObject
} else {
$v = $this->formatValue($v, $pair[1]);
$vx[] = $k . ($pair[1] === 'l' || $pair[1] === 'in' ? 'IN ' : ($v === 'NULL' ? 'IS ' : '= ')) . $v;
if ($pair[1] === 'l' || $pair[1] === 'in') {
$op = 'IN ';
} elseif (strpos($pair[1], 'like') !== FALSE) {
$op = 'LIKE ';
} elseif ($v === 'NULL') {
$op = 'IS ';
} else {
$op = '= ';
}
$vx[] = $k . $op . $v;
}
} else {