mirror of
https://github.com/dg/dibi.git
synced 2025-08-04 21:28:02 +02:00
DibiFluent passed as argument to DibiFluent is converted to string [Closes #44]
This commit is contained in:
@@ -181,10 +181,7 @@ class DibiFluent extends DibiObject implements IDataSource
|
|||||||
} elseif (is_string($arg) && preg_match('#^[a-z:_][a-z0-9_.:]*$#i', $arg)) { // identifier
|
} elseif (is_string($arg) && preg_match('#^[a-z:_][a-z0-9_.:]*$#i', $arg)) { // identifier
|
||||||
$args = array('%n', $arg);
|
$args = array('%n', $arg);
|
||||||
|
|
||||||
} elseif ($arg instanceof self) {
|
} elseif (is_array($arg) || ($arg instanceof Traversable && !$arg instanceof self)) { // any array
|
||||||
$args = array_merge(array('('), $arg->_export(), array(')'));
|
|
||||||
|
|
||||||
} elseif (is_array($arg) || $arg instanceof Traversable) { // any array
|
|
||||||
if (isset(self::$modifiers[$clause])) {
|
if (isset(self::$modifiers[$clause])) {
|
||||||
$args = array(self::$modifiers[$clause], $arg);
|
$args = array(self::$modifiers[$clause], $arg);
|
||||||
|
|
||||||
@@ -194,7 +191,12 @@ class DibiFluent extends DibiObject implements IDataSource
|
|||||||
} // case $arg === FALSE is handled above
|
} // case $arg === FALSE is handled above
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($args as $arg) $this->cursor[] = $arg;
|
foreach ($args as $arg) {
|
||||||
|
if ($arg instanceof self) {
|
||||||
|
$arg = "($arg)";
|
||||||
|
}
|
||||||
|
$this->cursor[] = $arg;
|
||||||
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user