mirror of
https://github.com/dg/dibi.git
synced 2025-08-04 21:28:02 +02:00
This commit is contained in:
@@ -316,11 +316,12 @@ class DibiFluent extends DibiObject implements IDataSource
|
|||||||
*/
|
*/
|
||||||
public function fetch()
|
public function fetch()
|
||||||
{
|
{
|
||||||
if ($this->command === 'SELECT') {
|
if ($this->command === 'SELECT' && !$this->clauses['LIMIT']) {
|
||||||
return $this->query($this->_export(NULL, array('%lmt', 1)))->fetch();
|
$result = $this->query($this->limit(1)->_export())->fetch();
|
||||||
} else {
|
$this->removeClause('LIMIT');
|
||||||
return $this->query($this->_export())->fetch();
|
return $result;
|
||||||
}
|
}
|
||||||
|
return $this->query($this->_export())->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -330,11 +331,12 @@ class DibiFluent extends DibiObject implements IDataSource
|
|||||||
*/
|
*/
|
||||||
public function fetchSingle()
|
public function fetchSingle()
|
||||||
{
|
{
|
||||||
if ($this->command === 'SELECT') {
|
if ($this->command === 'SELECT' && !$this->clauses['LIMIT']) {
|
||||||
return $this->query($this->_export(NULL, array('%lmt', 1)))->fetchSingle();
|
$result = $this->query($this->limit(1)->_export())->fetchSingle();
|
||||||
} else {
|
$this->removeClause('LIMIT');
|
||||||
return $this->query($this->_export())->fetchSingle();
|
return $result;
|
||||||
}
|
}
|
||||||
|
return $this->query($this->_export())->fetchSingle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user