/** * Gets a table value for a given User ID * NOTE: once some of the constraints have been finalized, this will use more of the Database functions and not raw SQL */ static function getTableValue($event_id, $userDef, $minTime = '', $maxTime = '', $normalize_results = false) { $dbr = wfGetDB(DB_SLAVE); $conds = array_merge(self::getTimeConstraints($minTime, $maxTime), SpecialClickTracking::buildUserDefConstraints($userDef), array('event_id' => $event_id)); return wfGetDB(DB_SLAVE)->selectField('click_tracking', 'count(*)', $conds, __METHOD__); }