thesportsdb-client

Event extends ApiRecord
in package

Read onlyYes
FinalYes

A game, match, race or other event. Also used for video highlights.

Schedules and lists fill fewer fields than a lookup by id: v1 eventsseason.php and v2 schedule/... leave out descriptions, officials, spectators and the like.

Times:** [timestamp], [date] and [time] are UTC. [localDate] and [localTime] are the venue's local time and are often missing for future events.

Table of Contents

Properties

$alternateName  : string|null
`strEventAlternate`, e.g. `Chelsea @ Arsenal`
$apiFootballId  : int|null
`idAPIfootball`
$awayScore  : int|null
`intAwayScore`
$awayScoreExtra  : int|null
`intAwayScoreExtra`
$awayTeam  : string|null
`strAwayTeam`
$awayTeamBadge  : string|null
`strAwayTeamBadge`
$awayTeamId  : int|null
`idAwayTeam`
$banner  : string|null
`strBanner`
$city  : string|null
`strCity`
$country  : string|null
`strCountry`
$date  : DateTimeImmutable|null
`dateEvent` (UTC) (a date, as midnight UTC)
$description  : string|null
`strDescriptionEN`
$fanart  : string|null
`strFanart`
$filename  : string|null
`strFilename`: `{league} {date} {home} vs {away}`, searchable with `searchfilename.php`
$group  : string|null
`strGroup`: a cup group or conference
$homeScore  : int|null
`intHomeScore`: null until the event has a score
$homeScoreExtra  : int|null
`intHomeScoreExtra`: extra time or shoot-out
$homeTeam  : string|null
`strHomeTeam`
$homeTeamBadge  : string|null
`strHomeTeamBadge`
$homeTeamId  : int|null
`idHomeTeam`
$id  : int|null
`idEvent`
$isLocked  : bool|null
`strLocked`
$isPostponed  : bool|null
`strPostponed`
$league  : string|null
`strLeague`
$leagueBadge  : string|null
`strLeagueBadge`
$leagueId  : int|null
`idLeague`
$localDate  : DateTimeImmutable|null
`dateEventLocal`: the venue's local date (a date, as midnight UTC)
$localTime  : string|null
`strTimeLocal`: the venue's local time (HH:MM:SS)
$map  : string|null
`strMap`
$name  : string|null
`strEvent`, e.g. `Arsenal vs Chelsea`
$official  : string|null
`strOfficial`: the referee
$poster  : string|null
`strPoster`
$rating  : float|null
`intScore`: the users' rating of the event
$ratingVotes  : int|null
`intScoreVotes`
$raw  : array<string|int, mixed>
$resultText  : string|null
`strResult`: free-text result, sometimes with HTML `<br>`
$round  : int|null
`intRound`: matchday or round number, or a stage code (125 quarter-final … 500 pre-season); see [stage]
$season  : string|null
`strSeason`
$spectators  : int|null
`intSpectators`
$sport  : string|null
`strSport`
$square  : string|null
`strSquare`
$statusCode  : string|null
`strStatus`: the raw code (`NS`, `2H`, `FT`, `Q3`, `PST`...); see [status]
$thumb  : string|null
`strThumb`
$time  : string|null
`strTime` (UTC) (HH:MM:SS)
$timestamp  : DateTimeImmutable|null
`strTimestamp`: the start time (UTC) (UTC)
$tweet  : string|null
`strTweet1`
$venue  : string|null
`strVenue`
$venueId  : int|null
`idVenue`
$video  : string|null
`strVideo`: a highlights video, usually YouTube
$weather  : string|null
`strWeather`

Methods

__construct()  : mixed
__toString()  : string
equals()  : bool
True when $other is the same kind of record, built from the same API fields.
stage()  : RoundStage|null
The stage when `round` is a stage code (e.g. 200 = final), or null for an ordinary round.
status()  : EventStatus
The status code read as a broad status.
fmt()  : string

Properties

$alternateName

`strEventAlternate`, e.g. `Chelsea @ Arsenal`

public string|null $alternateName

$apiFootballId

`idAPIfootball`

public int|null $apiFootballId

$awayScore

`intAwayScore`

public int|null $awayScore

$awayScoreExtra

`intAwayScoreExtra`

public int|null $awayScoreExtra

$awayTeam

`strAwayTeam`

public string|null $awayTeam

$awayTeamBadge

`strAwayTeamBadge`

public string|null $awayTeamBadge

$awayTeamId

`idAwayTeam`

public int|null $awayTeamId

$banner

`strBanner`

public string|null $banner

$city

`strCity`

public string|null $city

$country

`strCountry`

public string|null $country

$date

`dateEvent` (UTC) (a date, as midnight UTC)

public DateTimeImmutable|null $date

$description

`strDescriptionEN`

public string|null $description

$fanart

`strFanart`

public string|null $fanart

$filename

`strFilename`: `{league} {date} {home} vs {away}`, searchable with `searchfilename.php`

public string|null $filename

$group

`strGroup`: a cup group or conference

public string|null $group

$homeScore

`intHomeScore`: null until the event has a score

public int|null $homeScore

$homeScoreExtra

`intHomeScoreExtra`: extra time or shoot-out

public int|null $homeScoreExtra

$homeTeam

`strHomeTeam`

public string|null $homeTeam

$homeTeamBadge

`strHomeTeamBadge`

public string|null $homeTeamBadge

$homeTeamId

`idHomeTeam`

public int|null $homeTeamId

$id

`idEvent`

public int|null $id

$isLocked

`strLocked`

public bool|null $isLocked

$isPostponed

`strPostponed`

public bool|null $isPostponed

$league

`strLeague`

public string|null $league

$leagueBadge

`strLeagueBadge`

public string|null $leagueBadge

$leagueId

`idLeague`

public int|null $leagueId

$localDate

`dateEventLocal`: the venue's local date (a date, as midnight UTC)

public DateTimeImmutable|null $localDate

$localTime

`strTimeLocal`: the venue's local time (HH:MM:SS)

public string|null $localTime

$map

`strMap`

public string|null $map

$name

`strEvent`, e.g. `Arsenal vs Chelsea`

public string|null $name

$official

`strOfficial`: the referee

public string|null $official

$poster

`strPoster`

public string|null $poster

$rating

`intScore`: the users' rating of the event

public float|null $rating

$ratingVotes

`intScoreVotes`

public int|null $ratingVotes

$resultText

`strResult`: free-text result, sometimes with HTML `<br>`

public string|null $resultText

$round

`intRound`: matchday or round number, or a stage code (125 quarter-final … 500 pre-season); see [stage]

public int|null $round

$season

`strSeason`

public string|null $season

$spectators

`intSpectators`

public int|null $spectators

$sport

`strSport`

public string|null $sport

$square

`strSquare`

public string|null $square

$statusCode

`strStatus`: the raw code (`NS`, `2H`, `FT`, `Q3`, `PST`...); see [status]

public string|null $statusCode

$thumb

`strThumb`

public string|null $thumb

$time

`strTime` (UTC) (HH:MM:SS)

public string|null $time

$timestamp

`strTimestamp`: the start time (UTC) (UTC)

public DateTimeImmutable|null $timestamp

$tweet

`strTweet1`

public string|null $tweet

$venue

`strVenue`

public string|null $venue

$venueId

`idVenue`

public int|null $venueId

$video

`strVideo`: a highlights video, usually YouTube

public string|null $video

$weather

`strWeather`

public string|null $weather

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

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

stage()

The stage when `round` is a stage code (e.g. 200 = final), or null for an ordinary round.

public stage() : RoundStage|null
Return values
RoundStage|null

fmt()

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

Search results