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

- query returns DibiResult or number of affected rows now

This commit is contained in:
David Grudl
2009-02-05 02:13:15 +00:00
parent bf6dc1cbd1
commit 32ed383326
3 changed files with 11 additions and 7 deletions

View File

@@ -240,12 +240,14 @@ class DibiFluent extends DibiObject implements Countable, IteratorAggregate
/**
* Generates and executes SQL query.
* @return DibiResult|NULL result set object (if any)
* @param mixed what to return?
* @return DibiResult|int result set object (if any)
* @throws DibiException
*/
public function execute()
public function execute($return = NULL)
{
return $this->connection->query($this->_export());
$res = $this->connection->query($this->_export());
return $return === dibi::IDENTIFIER ? $this->connection->insertId() : $res;
}