Player
extends ApiRecord
in package
A player, manager or other person. Search and list endpoints fill only some fields; look the player up by id for the rest.
Table of Contents
Properties
- $agent : string|null
- `strAgent`
- $alternateName : string|null
- `strPlayerAlternate`
- $banner : string|null
- `strBanner`
- $birthLocation : string|null
- `strBirthLocation`
- $born : DateTimeImmutable|null
- `dateBorn` (a date, as midnight UTC)
- $cartoon : string|null
- `strCartoon`
- $college : string|null
- `strCollege`
- $creativeCommons : bool|null
- `strCreativeCommons`: whether the artwork is Creative Commons. TheSportsDB's terms say artwork that isn't (false or null) must not be used in published apps.
- $creativeCommonsAttribution : string|null
- `strCreativeCommonsAttribution`: the credit line to show
- $cutout : string|null
- `strCutout`: transparent head-and-shoulders
- $deathLocation : string|null
- `strDeathLocation`
- $descriptions : array<string, string>
- $died : DateTimeImmutable|null
- `dateDied` (a date, as midnight UTC)
- $ethnicity : string|null
- `strEthnicity`
- $externalIds : PlayerExternalIds
- $fanart : array<int, string>
- $gender : string|null
- `strGender`
- $height : string|null
- `strHeight`, as text: `1.82 m (6 ft 0 in)` or `186 cm`
- $id : int|null
- `idPlayer`
- $isLocked : bool|null
- `strLocked`
- $kit : string|null
- `strKit`: boot or equipment model
- $lastName : string|null
- `strLastName`
- $loved : int|null
- `intLoved`
- $managerId : int|null
- `idPlayerManager`: this person's record as a manager
- $name : string|null
- `strPlayer`
- $nationality : string|null
- `strNationality`
- $nationalTeamId : int|null
- `idTeamNational`
- $number : string|null
- `strNumber`: the shirt number, as text
- $outfitter : string|null
- `strOutfitter`
- $position : string|null
- `strPosition`
- $poster : string|null
- `strPoster`
- $raw : array<string|int, mixed>
- $relevance : float|null
- `relevance`: search score (v1 `searchplayers.php` only)
- $render : string|null
- `strRender`: transparent full body
- $secondTeam : string|null
- `strTeam2`, often the national team
- $secondTeamId : int|null
- `idTeam2`
- $side : string|null
- `strSide`: `Left`/`Right` (preferred foot or hand)
- $signed : DateTimeImmutable|null
- `dateSigned` (a date, as midnight UTC)
- $signing : string|null
- `strSigning`: the fee as text, e.g. `£25.20m`
- $socials : Socials
- $sport : string|null
- `strSport`
- $status : string|null
- `strStatus`, e.g. `Active`, `Retired`
- $team : string|null
- `strTeam`
- $teamId : int|null
- `idTeam`
- $thumb : string|null
- `strThumb`
- $wage : string|null
- `strWage`, as text
- $weight : string|null
- `strWeight`, as text
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
Properties
$agent
`strAgent`
public
string|null
$agent
$alternateName
`strPlayerAlternate`
public
string|null
$alternateName
$banner
`strBanner`
public
string|null
$banner
$birthLocation
`strBirthLocation`
public
string|null
$birthLocation
$born
`dateBorn` (a date, as midnight UTC)
public
DateTimeImmutable|null
$born
$cartoon
`strCartoon`
public
string|null
$cartoon
$college
`strCollege`
public
string|null
$college
$creativeCommons
`strCreativeCommons`: whether the artwork is Creative Commons. TheSportsDB's terms say artwork that isn't (false or null) must not be used in published apps.
public
bool|null
$creativeCommons
$creativeCommonsAttribution
`strCreativeCommonsAttribution`: the credit line to show
public
string|null
$creativeCommonsAttribution
$cutout
`strCutout`: transparent head-and-shoulders
public
string|null
$cutout
$deathLocation
`strDeathLocation`
public
string|null
$deathLocation
$descriptions
public
array<string, string>
$descriptions
strDescriptionEN, ... keyed by language code
$died
`dateDied` (a date, as midnight UTC)
public
DateTimeImmutable|null
$died
$ethnicity
`strEthnicity`
public
string|null
$ethnicity
$externalIds
public
PlayerExternalIds
$externalIds
$fanart
public
array<int, string>
$fanart
strFanart1..strFanart4
$gender
`strGender`
public
string|null
$gender
$height
`strHeight`, as text: `1.82 m (6 ft 0 in)` or `186 cm`
public
string|null
$height
$id
`idPlayer`
public
int|null
$id
$isLocked
`strLocked`
public
bool|null
$isLocked
$kit
`strKit`: boot or equipment model
public
string|null
$kit
$lastName
`strLastName`
public
string|null
$lastName
$loved
`intLoved`
public
int|null
$loved
$managerId
`idPlayerManager`: this person's record as a manager
public
int|null
$managerId
$name
`strPlayer`
public
string|null
$name
$nationality
`strNationality`
public
string|null
$nationality
$nationalTeamId
`idTeamNational`
public
int|null
$nationalTeamId
$number
`strNumber`: the shirt number, as text
public
string|null
$number
$outfitter
`strOutfitter`
public
string|null
$outfitter
$position
`strPosition`
public
string|null
$position
$poster
`strPoster`
public
string|null
$poster
$raw
public
array<string|int, mixed>
$raw
$relevance
`relevance`: search score (v1 `searchplayers.php` only)
public
float|null
$relevance
$render
`strRender`: transparent full body
public
string|null
$render
$secondTeam
`strTeam2`, often the national team
public
string|null
$secondTeam
$secondTeamId
`idTeam2`
public
int|null
$secondTeamId
$side
`strSide`: `Left`/`Right` (preferred foot or hand)
public
string|null
$side
$signed
`dateSigned` (a date, as midnight UTC)
public
DateTimeImmutable|null
$signed
$signing
`strSigning`: the fee as text, e.g. `£25.20m`
public
string|null
$signing
$socials
public
Socials
$socials
$sport
`strSport`
public
string|null
$sport
$status
`strStatus`, e.g. `Active`, `Retired`
public
string|null
$status
$team
`strTeam`
public
string|null
$team
$teamId
`idTeam`
public
int|null
$teamId
$thumb
`strThumb`
public
string|null
$thumb
$wage
`strWage`, as text
public
string|null
$wage
$weight
`strWeight`, as text
public
string|null
$weight
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
stringdescription()
The English description.
public
description() : string|null
Return values
string|nullequals()
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
boolfmt()
protected
fmt(mixed $value) : string
Parameters
- $value : mixed