thesportsdb-client

Team extends ApiRecord
in package

Read onlyYes
FinalYes

A team. Search and list endpoints fill only some fields (v2 `list/teams` has no alternate names, for example); a lookup by id fills them all.

Table of Contents

Properties

$alternateNames  : array<int, string>
$apiFootballId  : int|null
`idAPIfootball`
$badge  : string|null
`strBadge`
$banner  : string|null
`strBanner`
$colours  : array<int, string>
$country  : string|null
`strCountry`
$descriptions  : array<string, string>
$division  : string|null
`strDivision`
$equipment  : string|null
`strEquipment`: the current kit image
$espnId  : string|null
`idESPN`
$fanart  : array<int, string>
$formedYear  : int|null
`intFormedYear`
$gender  : string|null
`strGender`
$id  : int|null
`idTeam`
$isLocked  : bool|null
`strLocked`
$keywords  : array<int, string>
$league  : string|null
`strLeague`
$leagueId  : int|null
`idLeague`/`strLeague`: the main league
$leagues  : array<int, LeagueRef>
$location  : string|null
`strLocation`
$logo  : string|null
`strLogo`
$loved  : int|null
`intLoved`
$name  : string|null
`strTeam`
$raw  : array<string|int, mixed>
$shortName  : string|null
`strTeamShort`, e.g. `ARS`
$socials  : Socials
$sport  : string|null
`strSport`
$stadium  : string|null
`strStadium`
$venueId  : int|null
`idVenue`

Methods

__construct()  : mixed
__toString()  : string
description()  : string|null
The English description.
equals()  : bool
True when $other is the same kind of record, built from the same API fields.
fmt()  : string
leagues()  : array<int, LeagueRef>

Properties

$alternateNames

public array<int, string> $alternateNames

strTeamAlternate, split on commas

$apiFootballId

`idAPIfootball`

public int|null $apiFootballId

$badge

`strBadge`

public string|null $badge

$banner

`strBanner`

public string|null $banner

$colours

public array<int, string> $colours

strColour1..strColour3, hex like #EF0107

$country

`strCountry`

public string|null $country

$descriptions

public array<string, string> $descriptions

strDescriptionEN, strDescriptionDE, ... keyed by language code

$division

`strDivision`

public string|null $division

$equipment

`strEquipment`: the current kit image

public string|null $equipment

$espnId

`idESPN`

public string|null $espnId

$fanart

public array<int, string> $fanart

strFanart1..strFanart4

$formedYear

`intFormedYear`

public int|null $formedYear

$gender

`strGender`

public string|null $gender

$id

`idTeam`

public int|null $id

$isLocked

`strLocked`

public bool|null $isLocked

$keywords

public array<int, string> $keywords

strKeywords, split on commas (nicknames)

$league

`strLeague`

public string|null $league

$leagueId

`idLeague`/`strLeague`: the main league

public int|null $leagueId

$leagues

public array<int, LeagueRef> $leagues

Every league and cup the team is entered in: idLeague..idLeague7 with their names

$location

`strLocation`

public string|null $location

`strLogo`

public string|null $logo

$loved

`intLoved`

public int|null $loved

$name

`strTeam`

public string|null $name

$shortName

`strTeamShort`, e.g. `ARS`

public string|null $shortName

$sport

`strSport`

public string|null $sport

$stadium

`strStadium`

public string|null $stadium

$venueId

`idVenue`

public int|null $venueId

Methods

__construct()

public __construct(array<string, string|null> $raw) : mixed
Parameters
$raw : array<string, string|null>

every field as the API sent it (blank strings as null); use it for fields not modelled yet: $team->raw['strKeywords']

__toString()

public __toString() : string
Return values
string

description()

The English description.

public description() : string|null
Return values
string|null

equals()

True when $other is the same kind of record, built from the same API fields.

public equals(self|null $other) : bool
Parameters
$other : self|null
Return values
bool

fmt()

protected fmt(mixed $value) : string
Parameters
$value : mixed
Return values
string

leagues()

private static leagues(Rec $r) : array<int, LeagueRef>
Parameters
$r : Rec
Return values
array<int, LeagueRef>
On this page

Search results