2 require_once(
'./Services/GlobalCache/classes/class.ilGlobalCache.php');
31 protected $mode = self::MODE_SINGLE;
51 public function get() {
53 if ($ilGlobalCache->isActive()) {
54 $rec = $ilGlobalCache->get($this->cache_key);
56 $rec = $this->getFromDb();
57 $ilGlobalCache->set($this->cache_key, $rec, 600);
60 $rec = $this->getFromDb();
70 protected function getFromDb() {
76 $res = $ilDB->query($this->query);
78 case self::FETCH_TYPE_OBJECT:
79 while ($rec = $ilDB->fetchObject(
$res)) {
83 case self::FETCH_TYPE_ASSOC:
84 while ($rec = $ilDB->fetchAssoc(
$res)) {
90 if ($this->
getMode() == self::MODE_SINGLE) {
setFetchType($fetch_type)
static getInstance($component)
Class ilGlobalCacheQueryWrapper.
__construct($cache_key, $query, $fetch_type=self::FETCH_TYPE_OBJECT, $mode=self::MODE_SINGLE)