public static function &getSystems()
{
if (isset($GLOBALS['bx_dol_voting_systems'])) {
return $GLOBALS['bx_dol_voting_systems'];
}
$oCache = $GLOBALS['MySQL']->getDbCacheObject();
$GLOBALS['bx_dol_voting_systems'] = $oCache->getData($GLOBALS['MySQL']->genDbCacheKey('sys_objects_vote'));
if (null === $GLOBALS['bx_dol_voting_systems']) {
// cache is empty | load data from DB
$sQuery = "SELECT * FROM `sys_objects_vote`";
$rResult = db_res($sQuery);
$GLOBALS['bx_dol_voting_systems'] = array();
while ($aRow = $rResult->fetch()) {
$GLOBALS['bx_dol_voting_systems'][$aRow['ObjectName']] = array('table_rating' => $aRow['TableRating'], 'table_track' => $aRow['TableTrack'], 'row_prefix' => $aRow['RowPrefix'], 'max_votes' => $aRow['MaxVotes'], 'post_name' => $aRow['PostName'], 'is_duplicate' => is_int($aRow['IsDuplicate']) ? $aRow['IsDuplicate'] : constant($aRow['IsDuplicate']), 'is_on' => $aRow['IsOn'], 'className' => $aRow['className'], 'classFile' => $aRow['classFile'], 'trigger_table' => $aRow['TriggerTable'], 'trigger_field_rate' => $aRow['TriggerFieldRate'], 'trigger_field_rate_count' => $aRow['TriggerFieldRateCount'], 'trigger_field_id' => $aRow['TriggerFieldId'], 'override_class_name' => $aRow['OverrideClassName'], 'override_class_file' => $aRow['OverrideClassFile']);
}
// write data into cache file
$oCache = $GLOBALS['MySQL']->getDbCacheObject();
$oCache->setData($GLOBALS['MySQL']->genDbCacheKey('sys_objects_vote'), $GLOBALS['bx_dol_voting_systems']);
}
return $GLOBALS['bx_dol_voting_systems'];
}