/** * @see AbstractStatGenerator::createTemporaryEntry() */ protected function createTemporaryEntry($relationalID) { $sql = "SELECT MAX(rank)\n\t\t\t\t\tAS rank\n\t\t\t\tFROM ugml_stat_entry\n\t\t\t\tWHERE statTypeID = " . $this->statTypeID; $row = WCF::getDB()->getFirstRow($sql); $rank = $row['rank'] + 1; $sql = "INSERT INTO ugml_stat_entry\n\t\t\t\t(statTypeID, relationalID, rank, points)\n\t\t\t\tVALUES\n\t\t\t\t(" . $this->statTypeID . ", " . $relationalID . ", " . $rank . ", 1000)"; WCF::getDB()->sendQuery($sql); StatGeneratorFactory::init(); WCF::getCache()->clearResource('statTypes-' . PACKAGE_ID, true); }
/** * Creates a new StatRefresher object. */ public function __construct() { StatGeneratorFactory::init(); $cache = WCF::getCache()->get('statTypes-' . PACKAGE_ID, 'byStatTypeID'); foreach ($cache as $statTypeID => $row) { $statGenerator = StatGeneratorFactory::getByStatTypeID($statTypeID); $statGenerator->generate(); } $sql = "TRUNCATE wcf" . WCF_N . "_session"; WCF::getDB()->sendQuery($sql); }
/** * Returns the 'real' the name that should be selected in the select-field. * * @return string real option */ public function getOptionName() { StatGeneratorFactory::init(); $cache = WCF::getCache()->get('statTypes-' . PACKAGE_ID, 'byStatTypeID'); $name = $cache[$this->statTypeID]['name']; return $name; }