public function __construct() { if (self::$gamification != null) { return; } // Creation of gamification engine $gamification = new PHPGamification(); $gamification->setDAO(new DAO(GM_HOST, GM_DBNAME, GM_USERNAME, GM_PASSWORD)); self::$gamification = $gamification; }
/** * @return Badge * @throws \Exception */ public function getBadge() { return PHPGamification::getInstance()->getBadge($this->idBadge); }
function showUserScores(PHPGamification $gamification) { echo "<h2>getUserScores</h2>"; $score = $gamification->getUserScores(); echo "Points: " . $score->getPoints() . " - Id Level: " . $score->getIdLevel() . " - Progress: " . $score->getProgress() . " - Level Name: " . $score->getLevel()->getTitle() . "<br>"; }