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

added DibiFluent::REMOVE const

This commit is contained in:
David Grudl
2010-01-23 06:28:23 +01:00
parent 2395b83b03
commit b8600ee704

View File

@@ -20,6 +20,8 @@
*/ */
class DibiFluent extends DibiObject implements IDataSource class DibiFluent extends DibiObject implements IDataSource
{ {
const REMOVE = FALSE;
/** @var array */ /** @var array */
public static $masks = array( public static $masks = array(
'SELECT' => array('SELECT', 'DISTINCT', 'FROM', 'WHERE', 'GROUP BY', 'SELECT' => array('SELECT', 'DISTINCT', 'FROM', 'WHERE', 'GROUP BY',
@@ -132,14 +134,14 @@ class DibiFluent extends DibiObject implements IDataSource
$this->cursor = & $this->clauses[$clause]; $this->cursor = & $this->clauses[$clause];
// TODO: really delete? // TODO: really delete?
if ($args === array(FALSE)) { if ($args === array(self::REMOVE)) {
$this->cursor = NULL; $this->cursor = NULL;
return $this; return $this;
} }
if (isset(self::$separators[$clause])) { if (isset(self::$separators[$clause])) {
$sep = self::$separators[$clause]; $sep = self::$separators[$clause];
if ($sep === FALSE) { if ($sep === FALSE) { // means: replace
$this->cursor = array(); $this->cursor = array();
} elseif (!empty($this->cursor)) { } elseif (!empty($this->cursor)) {
@@ -149,7 +151,7 @@ class DibiFluent extends DibiObject implements IDataSource
} else { } else {
// append to currect flow // append to currect flow
if ($args === array(FALSE)) { if ($args === array(self::REMOVE)) {
return $this; return $this;
} }