Permalink
Browse files

Updating DboSource::conditions() to use cacheMethod(). Refs #458

  • Loading branch information...
1 parent c059cf5 commit 32432e8de6e9b78e45cd002dd9b53db56519b832 @markstory markstory committed Mar 14, 2010
Showing with 7 additions and 7 deletions.
  1. +7 −7 cake/libs/model/datasources/dbo_source.php
@@ -2050,8 +2050,8 @@ function conditions($conditions, $quoteValues = true, $where = true, $model = nu
$cacheKey = array($conditions, $quoteValues, $where);
}
$cacheKey = crc32(serialize($cacheKey));
- if (isset($this->methodCache[__FUNCTION__][$cacheKey])) {
- return $this->methodCache[__FUNCTION__][$cacheKey];
+ if ($return = $this->cacheMethod(__FUNCTION__, $cacheKey)) {
+ return $return;
}
$clause = $out = '';
@@ -2064,16 +2064,16 @@ function conditions($conditions, $quoteValues = true, $where = true, $model = nu
$out = $this->conditionKeysToString($conditions, $quoteValues, $model);
if (empty($out)) {
- return $this->methodCache[__FUNCTION__][$cacheKey] = $clause . ' 1 = 1';
+ return $this->cacheMethod(__FUNCTION__, $cacheKey, $clause . ' 1 = 1');
}
- return $this->methodCache[__FUNCTION__][$cacheKey] = $clause . implode(' AND ', $out);
+ return $this->cacheMethod(__FUNCTION__, $cacheKey, $clause . implode(' AND ', $out));
}
if ($conditions === false || $conditions === true) {
- return $this->methodCache[__FUNCTION__][$cacheKey] = $clause . (int)$conditions . ' = 1';
+ return $this->cacheMethod(__FUNCTION__, $cacheKey, $clause . (int)$conditions . ' = 1');
}
if (empty($conditions) || trim($conditions) == '') {
- return $this->methodCache[__FUNCTION__][$cacheKey] = $clause . '1 = 1';
+ return $this->cacheMethod(__FUNCTION__, $cacheKey, $clause . '1 = 1');
}
$clauses = '/^WHERE\\x20|^GROUP\\x20BY\\x20|^HAVING\\x20|^ORDER\\x20BY\\x20/i';
@@ -2085,7 +2085,7 @@ function conditions($conditions, $quoteValues = true, $where = true, $model = nu
} else {
$conditions = $this->__quoteFields($conditions);
}
- return $this->methodCache[__FUNCTION__][$cacheKey] = $clause . $conditions;
+ return $this->cacheMethod(__FUNCTION__, $cacheKey, $clause . $conditions);
}
/**

0 comments on commit 32432e8

Please sign in to comment.