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

Documentation for this module may be created at Module:OrganizationResults/doc

local util_args = require('Module:ArgsUtil')
local util_cargo = require("Module:CargoUtil")
local util_html = require("Module:HtmlUtil")
local util_map = require('Module:MapUtil')
local util_table = require("Module:TableUtil")
local util_text = require("Module:TextUtil")
local util_vars = require("Module:VarsUtil")
local i18n = require("Module:I18nUtil")
local lang = mw.getLanguage('en')

local Results = require('Module:TeamResultsAbstract'):extends()

function Results:init()
	self:super('init', 'Organization')
	self.limitOverviewpage = 10
	self.limitEverything = 500
	self.COLUMNS = { 'Date', 'PlaceDisplay', 'PrizeDisplay', 'Tournament', 'LastResult', 'TeamDisplay', 'Roster' }
end

local p = {}

function p.main(frame)
	local args = util_args.merge()
	return Results():run(args)
end

function Results:getSubject(args)
	return args[1] or mw.title.getCurrentTitle().baseText
end

-- cargo
function Results:getTables(args)
	local tables = self:super('getTables', args)
	table.insert(tables, 1, 'TeamRedirects=TR')
	table.insert(tables, 1, 'Teams')
	return tables
end

function Results:getJoin(args)
	local join = self:super('getJoin', args)
	-- im not sure if this join is in the right order
	table.insert(join, 1, 'Teams._pageName=TR._pageName')
	table.insert(join, 1, 'TR.AllName=Res.Team')
	return join
end

function Results:getSubjectWhereCondition(args, subject)
	return ('Teams.OrganizationPage="%s"'):format(subject)
end

return p
Advertisement