mirror of
https://github.com/dg/dibi.git
synced 2025-09-10 06:10:52 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
17df4d17fb | ||
|
51adcd98e0 | ||
|
aaa5abd4b6 | ||
|
e4acc4a2c8 |
@@ -39,8 +39,8 @@ class dibi
|
|||||||
FIELD_TIME = self::TIME;
|
FIELD_TIME = self::TIME;
|
||||||
|
|
||||||
/** version */
|
/** version */
|
||||||
const VERSION = '2.2.4',
|
const VERSION = '2.2.5',
|
||||||
REVISION = 'released on 2015-10-22';
|
REVISION = 'released on 2015-10-26';
|
||||||
|
|
||||||
/** sorting order */
|
/** sorting order */
|
||||||
const ASC = 'ASC',
|
const ASC = 'ASC',
|
||||||
|
@@ -188,6 +188,7 @@ class DibiFluent extends DibiObject implements IDataSource
|
|||||||
|
|
||||||
foreach ($args as $arg) {
|
foreach ($args as $arg) {
|
||||||
if ($arg instanceof self) {
|
if ($arg instanceof self) {
|
||||||
|
$this->cursor[] = '%SQL';
|
||||||
$arg = "($arg)";
|
$arg = "($arg)";
|
||||||
}
|
}
|
||||||
$this->cursor[] = $arg;
|
$this->cursor[] = $arg;
|
||||||
@@ -316,13 +317,12 @@ class DibiFluent extends DibiObject implements IDataSource
|
|||||||
*/
|
*/
|
||||||
public function fetch()
|
public function fetch()
|
||||||
{
|
{
|
||||||
if ($this->command === 'SELECT' && !$this->clauses['LIMIT']) {
|
if ($this->command === 'SELECT' && !$this->clauses['LIMIT'] && !$this->clauses['OFFSET']) {
|
||||||
$result = $this->query($this->limit(1)->_export())->fetch();
|
return $this->query($this->_export(NULL, array('%lmt', 1)))->fetch();
|
||||||
$this->removeClause('LIMIT');
|
} else {
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
return $this->query($this->_export())->fetch();
|
return $this->query($this->_export())->fetch();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -331,13 +331,12 @@ class DibiFluent extends DibiObject implements IDataSource
|
|||||||
*/
|
*/
|
||||||
public function fetchSingle()
|
public function fetchSingle()
|
||||||
{
|
{
|
||||||
if ($this->command === 'SELECT' && !$this->clauses['LIMIT']) {
|
if ($this->command === 'SELECT' && !$this->clauses['LIMIT'] && !$this->clauses['OFFSET']) {
|
||||||
$result = $this->query($this->limit(1)->_export())->fetchSingle();
|
return $this->query($this->_export(NULL, array('%lmt', 1)))->fetchSingle();
|
||||||
$this->removeClause('LIMIT');
|
} else {
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
return $this->query($this->_export())->fetchSingle();
|
return $this->query($this->_export())->fetchSingle();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -588,7 +588,7 @@ final class DibiTranslator extends DibiObject
|
|||||||
return $matches[9] == '' ? $this->formatValue($m, FALSE) : $m . $matches[9]; // value or identifier
|
return $matches[9] == '' ? $this->formatValue($m, FALSE) : $m . $matches[9]; // value or identifier
|
||||||
}
|
}
|
||||||
|
|
||||||
die('this should be never executed');
|
throw new Exception('this should be never executed');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1 +0,0 @@
|
|||||||
Dibi 2.2.3 (released on 2015-01-13)
|
|
Reference in New Issue
Block a user