1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-20 12:51:40 +02:00

- added DibiDataSource::release()

This commit is contained in:
David Grudl
2009-03-02 02:22:36 +00:00
parent 2f86997ca7
commit 5c2245a9d7
2 changed files with 13 additions and 2 deletions

View File

@@ -247,6 +247,17 @@ class DibiDataSource extends DibiObject implements IDataSource
/**
* Discards the internal cache.
* @return void
*/
public function release()
{
$this->result = $this->count = NULL;
}
/********************* exporting ****************d*g**/ /********************* exporting ****************d*g**/

View File

@@ -535,7 +535,7 @@ class DibiResult extends DibiObject implements IDataSource
{ {
$cols = array(); $cols = array();
foreach ($this->getMeta() as $info) { foreach ($this->getMeta() as $info) {
$cols[] = new DibiColumnInfo($this->driver, $info); $cols[] = new DibiColumnInfo($this->getDriver(), $info);
} }
return $cols; return $cols;
} }
@@ -626,7 +626,7 @@ class DibiResult extends DibiObject implements IDataSource
private function getDriver() private function getDriver()
{ {
if ($this->driver === NULL) { if ($this->driver === NULL) {
throw new InvalidStateException('Resultset was released from memory.'); throw new InvalidStateException('Result-set was released from memory.');
} }
return $this->driver; return $this->driver;