Leaguepedia | League of Legends Esports Wiki
Advertisement
Leaguepedia | League of Legends Esports Wiki

To edit the documentation or categories for this module, click here.


local util_args = require("Module:ArgsUtil")
local util_cargo = require("Module:CargoUtil")
local util_table = require("Module:TableUtil")

local PBHQ = require('Module:PickBanHistoryQueryAbstract'):extends()

PBHQ.FORM_INFO = { form = 'PickBanHistoryTeam', template = 'PBHT' }

function PBHQ:makeQuery()
	local query = self:super('makeQuery')
	query.limit = self.args.limit or 50
	query.orderBy = 'MS.DateTime_UTC DESC, PB.N_GameInMatch DESC'
	return query
end

function PBHQ:getWhere()
	local where = self:super('getWhere')
	local team = self.args.team:get()
	local tbl = {
		team and ('(PB.Team1="%s" OR PB.Team2="%s")'):format(team, team)
	}
	util_table.mergeArrays(where, tbl)
	return where
end

function PBHQ:queryEntityDisplayName()
	return self.args.team:get()
end

function PBHQ:queryEntityMarkup()
	return self.args.team:flairlink()
end

return PBHQ
Advertisement