Attempts to get the game by the id.

@param int $gameId
@return MasteryPage|null
168751
public function recentGame($gameId)
	{
		if ( ! isset($this->info['recentGames']))
		{
			// no rune pages
			return null;
		}
		$recentGames = $this->info['recentGames'];

		return $recentGames->game($gameId);
	}
654214
public function rankingTeamMedalsAction($id)
    {
        $group = $this->getDoctrine()->getRepository('VideoGamesRecordsCoreBundle:Group')->getWithGame($id);

        $breadcrumbs = $this->getGroupBreadcrumbs($group);
        $breadcrumbs->addItem('game.medalranking.full');

        return $this->render(
            'VideoGamesRecordsTeamBundle:Ranking:medals.html.twig',
            [
                'ranking' => $this->getDoctrine()->getRepository('VideoGamesRecordsTeamBundle:TeamGroup')->getRankingMedals($id, 100, null),
            ]
        );
    }
352294
protected function getReplayDirPath($region, $gameId)
    {
        $stringGameId = (string) $gameId;

        return sprintf(
            '%s/%s/%s/%s/%s/%s',
            $this->replaysDirPath,
            $region,
            $stringGameId[0] . $stringGameId[1],
            $stringGameId[2],
            $stringGameId[3],
            $gameId
        );
    }
1099128
public function getEndStats($region, $gameId)
    {
        $filePath = $this->getReplayDirPath($region, $gameId) . '/endstats';

        if (!is_file($filePath)) {
            throw new ReplayEndStatsNotFoundException('The endstats for game #' . $gameId . ' is not found');
        }

        return $filePath;
    }
1079954
public static function get_by_courseid($courseid) {
        global $DB;

        $params = array(
            'courseid' => $courseid
        );

        $settings = new static(null, (object) $params);
        if ($record = $DB->get_record(self::TABLE, $params)) {
            $settings->from_record($record);
        }

        return $settings;
    }
115821
public function getPlayer($id)
    {
        foreach ($this->header()->players as $player) {
            if ($player->index === $id) {
                return $player;
            }
        }
    }
993144
protected function getCache($documentId)
    {
        if (isset($this->cache[$documentId])) {
            return $this->cache[$documentId];
        }

        return null;
    }
285256
public static function getStaticMastery( int $mastery_id, string $locale = 'en_US', string $version = null ) : array
	{
		$data = self::getStaticMasteries($locale, $version);
		if (isset($data['data'][$mastery_id]) == false)
			throw new ArgumentException('Mastery with given ID was not found.', 404);

		return $data['data'][$mastery_id];
	}
1113078
public function get_competency($competencyid) {
        $competency = null;

        if ($this->get('status') == self::STATUS_COMPLETE) {
            // Get the competency from the archive of the plan.
            $competency = user_competency_plan::get_competency_by_planid($this->get('id'), $competencyid);
        } else if ($this->is_based_on_template()) {
            // Get the competency from the template.
            $competency = template_competency::get_competency($this->get('templateid'), $competencyid);
        } else {
            // Get the competency from the plan.
            $competency = plan_competency::get_competency($this->get('id'), $competencyid);
        }
        return $competency;
    }
211736
public function getMastery($masteryId, $data = null)
	{
		$params = $this->setUpParams('mastery', $masteryId, $data, 'masteryListData', 'masteryData');
		$array  = $this->makeRequest('mastery', $masteryId, $params);

		if ($this->appendId($masteryId))
		{
			return new staticMastery($array);
		}
		else
		{
			return new MasteryList($array);
		}
	}
862326
public function getRecord($id, $versionID = null)
    {
        if (!$id) {
            return null;
        }
        $treeClass = $this->config()->get('tree_class');
        if ($id instanceof $treeClass) {
            return $id;
        }
        if (substr($id, 0, 3) == 'new') {
            return $this->getNewItem($id);
        }
        if (!is_numeric($id)) {
            return null;
        }

        $currentStage = Versioned::get_reading_mode();

        if ($this->getRequest()->getVar('Version')) {
            $versionID = (int) $this->getRequest()->getVar('Version');
        }

        /** @var SiteTree $record */
        if ($versionID) {
            $record = Versioned::get_version($treeClass, $id, $versionID);
        } else {
            $record = DataObject::get_by_id($treeClass, $id);
        }

        // Then, try getting a record from the live site
        if (!$record) {
            // $record = Versioned::get_one_by_stage($treeClass, "Live", "\"$treeClass\".\"ID\" = $id");
            Versioned::set_stage(Versioned::LIVE);
            singleton($treeClass)->flushCache();

            $record = DataObject::get_by_id($treeClass, $id);
        }

        // Then, try getting a deleted record
        if (!$record) {
            $record = Versioned::get_latest_version($treeClass, $id);
        }

        // Set the reading mode back to what it was.
        Versioned::set_reading_mode($currentStage);

        return $record;
    }
831647
public function findOneById($seoId)
    {
        $qb = $this->createQueryBuilder('s');
        $query = $qb
            ->andWhere($qb->expr()->eq('s.id', $seoId))
            ->setMaxResults(1)
            ->getQuery()
            //->useResultCache(true, 3600, 'ekyna_cms.seo[id:'.$seoId.']') // TODO doctrine cache clear/update
        ;
        return $query->getOneOrNullResult();
    }
889344
public function player($playerId)
	{
		if ( ! isset($this->info['fellowPlayers']))
		{
			// no players
			return null;
		}
		$players = $this->info['fellowPlayers'];
		if (isset($players[$playerId]))
		{
			return $players[$playerId];
		}

		return null;
	}
150587
public function getPage($id)
    {
        return isset($this->pages[$id])?$this->pages[$id]:null;
    }
912259
public function getGuildMember4GuildId($id)
    {
        /** @var \GameBackend\Entity\SRO\Shard\Repository\GuildMember $repository */
        $repository = $this->getShardEntityManager()->getRepository($this->getGameOptions()->getEntityShardGuildMember());
        return $repository->getGuildMember4GuildId($id);
    }
466629
public function getMastery($masteryId)
	{
		if (isset($this->info['data'][$masteryId]))
		{
			return $this->info['data'][$masteryId];
		}

		return null;
	}
1286813
public function getBid($itemId)
    {
        $item = Item::findOrFail($itemId);

        if (!$item->auction) {
            return redirect($item->url)->withErrors([
                'This item is not an auction, so cannot be bid on.',
            ]);
        }

        $bids = $item->getBidHistory();

        $highest_bid = $bids->first() ?: new Bid();

        if ($bids->isEmpty()) {
            $minimum_bid = $item->startPrice;
        } elseif ($highest_bid->bidder == Auth::user()) {
            $minimum_bid = BidIncrement::getMinimumNextBid($highest_bid->amount);
        } else {
            $minimum_bid = BidIncrement::getMinimumNextBid($item->biddingPrice);
        }

        return view('mustard::item.bid', [
            'item'        => $item,
            'bids'        => $bids,
            'highest_bid' => $highest_bid,
            'minimum_bid' => $minimum_bid,
        ]);
    }