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;
 }
Ejemplo n.º 2
0
 /**
  * @return Badge
  * @throws \Exception
  */
 public function getBadge()
 {
     return PHPGamification::getInstance()->getBadge($this->idBadge);
 }
Ejemplo n.º 3
0
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>";
}