1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-13 17:44:11 +02:00

- DibiResult: setWithTables() and setRowClass() provide a fluent interface

- DibiTranslator: enhanced arrays syntax
This commit is contained in:
David Grudl
2009-05-24 23:32:42 +00:00
parent fb8054d21a
commit 43c7e70e90
2 changed files with 7 additions and 5 deletions

View File

@@ -251,7 +251,7 @@ final class DibiTranslator extends DibiObject
foreach ($value as $k => $v) {
$pair = explode('%', $k, 2); // split into identifier & modifier
$vx[] = $this->delimite($pair[0]) . '='
. $this->formatValue($v, isset($pair[1]) ? $pair[1] : FALSE);
. $this->formatValue($v, isset($pair[1]) ? $pair[1] : is_array($v) ? 'ex' : FALSE);
}
return implode(', ', $vx);
@@ -259,7 +259,7 @@ final class DibiTranslator extends DibiObject
case 'l': // (val, val, ...)
foreach ($value as $k => $v) {
$pair = explode('%', $k, 2); // split into identifier & modifier
$vx[] = $this->formatValue($v, isset($pair[1]) ? $pair[1] : FALSE);
$vx[] = $this->formatValue($v, isset($pair[1]) ? $pair[1] : is_array($v) ? 'ex' : FALSE);
}
return '(' . ($vx ? implode(', ', $vx) : 'NULL') . ')';
@@ -268,7 +268,7 @@ final class DibiTranslator extends DibiObject
foreach ($value as $k => $v) {
$pair = explode('%', $k, 2); // split into identifier & modifier
$kx[] = $this->delimite($pair[0]);
$vx[] = $this->formatValue($v, isset($pair[1]) ? $pair[1] : FALSE);
$vx[] = $this->formatValue($v, isset($pair[1]) ? $pair[1] : is_array($v) ? 'ex' : FALSE);
}
return '(' . implode(', ', $kx) . ') VALUES (' . implode(', ', $vx) . ')';