public static function getUserLevelByName($levelName)
 {
     if (!empty($levelName)) {
         $userLevels = GameUserLevel::findByExample(DBUtils::getConnection(), GameUserLevel::create()->setLevelName($levelName));
         if (count($userLevels) > 0) {
             $userLevel = $userLevels[0];
             unset($userLevels);
             if (!empty($userLevel)) {
                 $userLevelId = $userLevel->levelId;
                 if (!empty($userLevelId)) {
                     return $userLevel;
                 }
             }
         }
     }
     return null;
 }
Ejemplo n.º 2
0
 public function getUserLevel()
 {
     if (!empty($this->userLevelNumber)) {
         $this->userLevel = GameUserLevel::findByExample(DBUtils::getConnection(), GameUserLevel::create()->setLevelNumber($this->userLevelNumber));
     }
 }