summaryrefslogtreecommitdiff
path: root/idiorm.php
diff options
context:
space:
mode:
authorSimon Holywell <[email protected]>2018-01-03 17:14:25 +1000
committerSimon Holywell <[email protected]>2018-01-03 17:14:25 +1000
commit5f220f371dc250b1c65dfb5f767ebc8b8b40a92d (patch)
treec586545a9ce6e85522e96f4936b98d6986333193 /idiorm.php
parent16a53cddf06739c910d7899684370442daa01a4c (diff)
Closes #319 - no reset on cached response
Diffstat (limited to 'idiorm.php')
-rw-r--r--idiorm.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/idiorm.php b/idiorm.php
index 2ca9a93..0be3410 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -1899,6 +1899,7 @@
$cached_result = self::_check_query_cache($cache_key, $this->_table_name, $this->_connection_name);
if ($cached_result !== false) {
+ $this->_reset_idiorm_state();
return $cached_result;
}
}
@@ -1915,12 +1916,17 @@
self::_cache_query_result($cache_key, $rows, $this->_table_name, $this->_connection_name);
}
- // reset Idiorm after executing the query
+ $this->_reset_idiorm_state();
+ return $rows;
+ }
+
+ /**
+ * Reset the Idiorm instance state
+ */
+ private function _reset_idiorm_state() {
$this->_values = array();
$this->_result_columns = array('*');
$this->_using_default_result_columns = true;
-
- return $rows;
}
/**