function clearItemCache($id) { $sql = $this->_assembleSqlByID($id); $this->dbcon->CacheFlush($sql); AMP::debug_sql($sql, get_class($this) . " cleared cache"); $data_set =& $this->getCollection(); $data_set->clearCache(); }
function getLookup($field, $use_sort = false) { $set = array(); if (!$this->makeReady()) { $sql = "SELECT " . $this->getIdFieldLookups() . ", {$field} " . $this->_makeSource() . $this->_makeCriteria(); if ($use_sort) { $sql .= $this->_makeSort(); } $set = $this->dbcon->CacheGetAssoc($sql); AMP::debug_sql($sql, get_class($this) . ' lookup'); if (!$set && ($db_error = $this->dbcon->ErrorMsg())) { trigger_error(sprintf(AMP_TEXT_ERROR_LOOKUP_SQL_FAILED, get_class($this) . __FUNCTION__, $db_error) . $sql); } } else { while ($record = $this->getData()) { $set[$record['id']] = $record[$field]; } } return $set; }