|
@@ 198-210 (lines=13) @@
|
| 195 |
|
$ret = array(); |
| 196 |
|
$limit = $start = 0; |
| 197 |
|
$sql = 'SELECT ' . $fields . ' FROM ' . $this->table; |
| 198 |
|
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 199 |
|
$sql .= ' ' . $criteria->renderWhere(); |
| 200 |
|
if ($criteria->groupby != '') { |
| 201 |
|
$sql .= $criteria->getGroupby(); |
| 202 |
|
} |
| 203 |
|
if ($criteria->getSort() != '') { |
| 204 |
|
$sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
| 205 |
|
} elseif ($this->identifierName != '' && $autoSort) { |
| 206 |
|
$sql .= ' ORDER BY ' . $this->identifierName; |
| 207 |
|
} |
| 208 |
|
$limit = $criteria->getLimit(); |
| 209 |
|
$start = $criteria->getStart(); |
| 210 |
|
} |
| 211 |
|
$Cache_Lite = new references_Cache_Lite($this->cacheOptions); |
| 212 |
|
$id = $this->_getIdForCache($sql, $start, $limit); |
| 213 |
|
$cacheData = $Cache_Lite->get($id); |
|
@@ 292-304 (lines=13) @@
|
| 289 |
|
|
| 290 |
|
$Cache_Lite = new references_Cache_Lite($this->cacheOptions); |
| 291 |
|
$sql = 'SELECT ' . $this->keyName . ' FROM ' . $this->table; |
| 292 |
|
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 293 |
|
$sql .= ' ' . $criteria->renderWhere(); |
| 294 |
|
if ($criteria->groupby != '') { |
| 295 |
|
$sql .= $criteria->getGroupby(); |
| 296 |
|
} |
| 297 |
|
if ($criteria->getSort() != '') { |
| 298 |
|
$sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
| 299 |
|
} elseif ($this->identifierName != '') { |
| 300 |
|
$sql .= ' ORDER BY ' . $this->identifierName; |
| 301 |
|
} |
| 302 |
|
$limit = $criteria->getLimit(); |
| 303 |
|
$start = $criteria->getStart(); |
| 304 |
|
} |
| 305 |
|
|
| 306 |
|
$id = $this->_getIdForCache($sql, $start, $limit); |
| 307 |
|
$cacheData = $Cache_Lite->get($id); |
|
@@ 341-353 (lines=13) @@
|
| 338 |
|
$sql .= ', ' . $this->identifierName; |
| 339 |
|
} |
| 340 |
|
$sql .= ' FROM ' . $this->table; |
| 341 |
|
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 342 |
|
$sql .= ' ' . $criteria->renderWhere(); |
| 343 |
|
if ($criteria->groupby != '') { |
| 344 |
|
$sql .= $criteria->getGroupby(); |
| 345 |
|
} |
| 346 |
|
if ($criteria->getSort() != '') { |
| 347 |
|
$sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
| 348 |
|
} elseif ($this->identifierName != '') { |
| 349 |
|
$sql .= ' ORDER BY ' . $this->identifierName; |
| 350 |
|
} |
| 351 |
|
$limit = $criteria->getLimit(); |
| 352 |
|
$start = $criteria->getStart(); |
| 353 |
|
} |
| 354 |
|
|
| 355 |
|
$id = $this->_getIdForCache($sql, $start, $limit); |
| 356 |
|
$cacheData = $Cache_Lite->get($id); |