ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilGlobalCacheQueryWrapper Class Reference

Class ilGlobalCacheQueryWrapper. More...

+ Collaboration diagram for ilGlobalCacheQueryWrapper:

Public Member Functions

 __construct ($cache_key, $query, $fetch_type=self::FETCH_TYPE_OBJECT, $mode=self::MODE_SINGLE)
 get ()
 setFetchType ($fetch_type)
 getFetchType ()
 setMode ($mode)
 getMode ()

Data Fields

const FETCH_TYPE_ASSOC = 1
const FETCH_TYPE_OBJECT = 2
const MODE_SINGLE = 1
const MODE_MULTIPLE = 2

Protected Attributes

 $query = ''
 $cache_key = ''
 $fetch_type = self::FETCH_TYPE_OBJECT
 $mode = self::MODE_SINGLE

Detailed Description

Constructor & Destructor Documentation

ilGlobalCacheQueryWrapper::__construct (   $cache_key,
  $query,
  $fetch_type = self::FETCH_TYPE_OBJECT,
  $mode = self::MODE_SINGLE 
)
Parameters
$cache_key
$query
int$fetch_type
int$mode

Definition at line 40 of file class.ilGlobalCacheQueryWrapper.php.

References $cache_key, $fetch_type, $mode, and $query.

{
$this->cache_key = $cache_key;
$this->fetch_type = $fetch_type;
$this->mode = $mode;
$this->query = $query;
}

Member Function Documentation

ilGlobalCacheQueryWrapper::get ( )
Returns
array|mixed

Definition at line 51 of file class.ilGlobalCacheQueryWrapper.php.

References ilGlobalCache\getInstance().

{
$ilGlobalCache = ilGlobalCache::getInstance();
if ($ilGlobalCache->isActive()) {
$rec = $ilGlobalCache->get($this->cache_key);
if (! $rec) {
$rec = $this->getFromDb();
$ilGlobalCache->set($this->cache_key, $rec, 600);
}
} else {
$rec = $this->getFromDb();
}
return $rec;
}

+ Here is the call graph for this function:

ilGlobalCacheQueryWrapper::getFetchType ( )
Returns
int

Definition at line 109 of file class.ilGlobalCacheQueryWrapper.php.

References $fetch_type.

{
}
ilGlobalCacheQueryWrapper::getMode ( )
Returns
int

Definition at line 125 of file class.ilGlobalCacheQueryWrapper.php.

References $mode.

{
return $this->mode;
}
ilGlobalCacheQueryWrapper::setFetchType (   $fetch_type)
Parameters
int$fetch_type

Definition at line 101 of file class.ilGlobalCacheQueryWrapper.php.

References $fetch_type.

{
$this->fetch_type = $fetch_type;
}
ilGlobalCacheQueryWrapper::setMode (   $mode)
Parameters
int$mode

Definition at line 117 of file class.ilGlobalCacheQueryWrapper.php.

References $mode.

{
$this->mode = $mode;
}

Field Documentation

ilGlobalCacheQueryWrapper::$cache_key = ''
protected

Definition at line 23 of file class.ilGlobalCacheQueryWrapper.php.

Referenced by __construct().

ilGlobalCacheQueryWrapper::$fetch_type = self::FETCH_TYPE_OBJECT
protected

Definition at line 27 of file class.ilGlobalCacheQueryWrapper.php.

Referenced by __construct(), getFetchType(), and setFetchType().

ilGlobalCacheQueryWrapper::$mode = self::MODE_SINGLE
protected

Definition at line 31 of file class.ilGlobalCacheQueryWrapper.php.

Referenced by __construct(), getMode(), and setMode().

ilGlobalCacheQueryWrapper::$query = ''
protected

Definition at line 19 of file class.ilGlobalCacheQueryWrapper.php.

Referenced by __construct().

const ilGlobalCacheQueryWrapper::FETCH_TYPE_ASSOC = 1

Definition at line 12 of file class.ilGlobalCacheQueryWrapper.php.

const ilGlobalCacheQueryWrapper::FETCH_TYPE_OBJECT = 2

Definition at line 13 of file class.ilGlobalCacheQueryWrapper.php.

const ilGlobalCacheQueryWrapper::MODE_MULTIPLE = 2

Definition at line 15 of file class.ilGlobalCacheQueryWrapper.php.

const ilGlobalCacheQueryWrapper::MODE_SINGLE = 1

Definition at line 14 of file class.ilGlobalCacheQueryWrapper.php.


The documentation for this class was generated from the following file: