initial 2.0.0-a4 commit

This commit is contained in:
jerry
2020-11-03 21:02:24 +08:00
parent da584e0542
commit 29fa9d8662
48 changed files with 794 additions and 1470 deletions

View File

@@ -4,7 +4,6 @@
namespace ZM\DB;
use ZM\Console\Console;
use ZM\Exception\DbException;
class SelectBody
@@ -46,17 +45,7 @@ class SelectBody
* @throws DbException
*/
public function fetchAll($fetch_mode = ZM_DEFAULT_FETCH_MODE) {
if ($this->table->isCacheEnabled()) {
$rr = md5(implode(",", $this->select_thing) . serialize($this->where_thing));
if (array_key_exists($rr, $this->table->cache)) {
Console::debug('SQL query cached: ' . $rr);
return $this->table->cache[$rr]->getResult();
}
}
$this->execute($fetch_mode);
if ($this->table->isCacheEnabled() && !in_array($rr, $this->table->cache)) {
$this->table->cache[$rr] = $this;
}
return $this->getResult();
}