Returns the level in this skill for the given XP.

@param int $xp
@return int
433850
public function getLevel(int $xp): int
    {
        $level = $this->getVirtualLevel($xp);
        $cap = $this->isHighLevelCap() ? 120 : 99;

        return min($level, $cap);
    }
455306
public function level($level = null)
    {
        if ($level !== null) {
            $this->_level = $level;
        }

        return $this->_level;
    }
1181929
public function findOthersByCompetencyAndLevel(
        Competency $competency,
        Level $level,
        Ability $abilityToExclude
    ) {
        return $this->createQueryBuilder('a')
            ->select('a')
            ->join('a.competencyAbilities', 'ca')
            ->join('ca.competency', 'c')
            ->join('ca.level', 'l')
            ->where('c = :competency')
            ->andWhere('l = :level')
            ->andWhere('a <> :excluded')
            ->orderBy('l.value, a.id')
            ->setParameters([
                ':competency' => $competency,
                ':level' => $level,
                ':excluded' => $abilityToExclude,
            ])
            ->getQuery()
            ->getResult();
    }
1362481
public function getPK() {
        if ($this->_pk === null) {
            $this->_pk= $this->xpdo->getPK($this->_class);
        }
        return $this->_pk;
    }
338444
public static function getLevelName($level) {
        $level = (int) $level;
        if (!isset(self::$_levels[$level])) {
            throw new CM_Exception_Invalid('Level is not defined', null, [
                'level'           => $level,
                'availableLevels' => implode(', ', array_keys(self::$_levels)),
            ]);
        }
        return self::$_levels[$level];
    }
127428
private static function factorial($x)
    {
        $result = ($x === 0) ? 1 : $x * self::factorial($x - 1);
        if ($result >= PHP_INT_MAX) {
            return PHP_INT_MAX;
        }
        return $result;
    }
620259
public static function logLevel($level)
  {
    if(is_numeric($level))
    {
      if($level == TeamSpeak3::LOGLEVEL_CRITICAL)
        return "CRITICAL";
      if($level == TeamSpeak3::LOGLEVEL_ERROR)
        return "ERROR";
      if($level == TeamSpeak3::LOGLEVEL_DEBUG)
        return "DEBUG";
      if($level == TeamSpeak3::LOGLEVEL_WARNING)
        return "WARNING";
      if($level == TeamSpeak3::LOGLEVEL_INFO)
        return "INFO";

      return "DEVELOP";
    }
    else
    {
      if(strtoupper($level) == "CRITICAL")
        return TeamSpeak3::LOGLEVEL_CRITICAL;
      if(strtoupper($level) == "ERROR")
        return TeamSpeak3::LOGLEVEL_ERROR;
      if(strtoupper($level) == "DEBUG")
        return TeamSpeak3::LOGLEVEL_DEBUG;
      if(strtoupper($level) == "WARNING")
        return TeamSpeak3::LOGLEVEL_WARNING;
      if(strtoupper($level) == "INFO")
        return TeamSpeak3::LOGLEVEL_INFO;

      return TeamSpeak3::LOGLEVEL_DEVEL;
    }
  }
841493
private DefBase getDefForLevel(String level)
    {
        if (LEVEL_CLASS.equals(level))
        {
            return _curClassDef;
        }
        else if (LEVEL_FIELD.equals(level))
        {
            return _curFieldDef;
        }
        else if (LEVEL_REFERENCE.equals(level))
        {
            return _curReferenceDef;
        }
        else if (LEVEL_COLLECTION.equals(level))
        {
            return _curCollectionDef;
        }
        else if (LEVEL_OBJECT_CACHE.equals(level))
        {
            return _curObjectCacheDef;
        }
        else if (LEVEL_INDEX_DESC.equals(level))
        {
            return _curIndexDescriptorDef;
        }
        else if (LEVEL_TABLE.equals(level))
        {
            return _curTableDef;
        }
        else if (LEVEL_COLUMN.equals(level))
        {
            return _curColumnDef;
        }
        else if (LEVEL_FOREIGNKEY.equals(level))
        {
            return _curForeignkeyDef;
        }
        else if (LEVEL_INDEX.equals(level))
        {
            return _curIndexDef;
        }
        else if (LEVEL_PROCEDURE.equals(level))
        {
            return _curProcedureDef;
        }
        else if (LEVEL_PROCEDURE_ARGUMENT.equals(level))
        {
            return _curProcedureArgumentDef;
        }
        else
        {
            return null;
        }
    }
1205127
public function getTotal($user)
    {
        $leaderboardType = $this->getLeaderboardTypeService()->getLeaderboardTypeDefault();
        $leaderboardUser = $this->getLeaderboardMapper()->findOneBy(
            array(
                'user' => $user,
                'leaderboardType' => $leaderboardType
            )
        );
        if (!$leaderboardUser) {
            return 0;
        }
        return $leaderboardUser->getTotalPoints();
    }
993014
public function level($level, $operator = '>=')
	{
		if (!$this->user())
		{
			return false;
		}

		$userCaps = array_keys($this->getUser()->allcaps);

		foreach ($userCaps as $cap)
		{
			// get just the first, higher
			if (substr($cap, 0, 6) === 'level_')
			{
				return $this->checkWithOperator(substr($cap, 6), $level, $operator);
			}
		}

		return false;
	}
21267
protected function getLevelByType($type)
    {
        $level = 0;

        if (isset($this->availableLogtypes[$type])) {
            $level = $this->availableLogtypes[$type];
        }

        return $level;
    }
405515
private function getTotalFromPercent(\SimpleXMLElement $percent)
    {
        $percent = (string)$percent;
        $percent = substr($percent, 0, -1);
        return round($percent);
    }
744051
protected function getLevel()
  {
    if($this->currObj instanceof TeamSpeak3_Node_Channel)
    {
      return $this->currObj->getLevel()+2;
    }
    elseif($this->currObj instanceof TeamSpeak3_Node_Client)
    {
      return $this->currObj->channelGetById($this->currObj->cid)->getLevel()+3;
    }

    return 1;
  }
244772
public static function isLevelFatal($level)
    {
        $errors = E_ERROR;
        $errors |= E_PARSE;
        $errors |= E_CORE_ERROR;
        $errors |= E_CORE_WARNING;
        $errors |= E_COMPILE_ERROR;
        $errors |= E_COMPILE_WARNING;
        return ($level & $errors) > 0;
    }
1254687
public function total($level = 'all')
    {
        return (int) $this->sum(function (Log $log) use ($level) {
            return $log->entries($level)->count();
        });
    }
237040
protected function normalizeLevel($level)
    {
        if (is_int($level) && array_search($level, self::$levels) !== false) {
            return $level;
        }

        if (is_string($level) && isset(self::$levels[$level])) {
            return self::$levels[$level];
        }

        throw new Exception(
            sprintf("Unknown LogLevel: '%s'", $level)
        );
    }
680177
protected function getPatchLevel()
    {
        if (isset($this->searchData['gpa_level']) && $this->searchData['gpa_level']) {
            return $this->searchData['gpa_level'];
        }

        return reset($this->patchLevels);
    }