BattleLog

BattleLogList Object

Retrieve a player's battle log

$battleLogs = $client->getPlayerBattleLog('player tag');

retrieving a battle log returns a BattleLogList Object. Any List object has special query function such as all(), first(), filter() etc. To find out more about the List query function visit the List page.

The BattleLogList contains BattleLog Objects.

latest

return the latest battle log of the player. This returns a BattleLog Object

$battleLog = $battleLogs->latest();

BattleLog

battleTime

return the battle time of a battle

$battleTime = $battleLog->battleTime();

battle

retrieve the battle from the battle log. This returns a Battle Object.

$battle = $battleLog->battle()

event

retrieve the event in which the battle occurred. This returns an Event object. To see the Event properties and methods refer to the Event page.

$battleEvent = $battleLog->event();
$battleMap = $battleLog->event()->map();

Battle

Each battleLog contains a Battle Object

mode

returns the mode of the battle

$battleMode = $battle->mode() // solo showdown

result

returns the result of the battle

$battleResult = $battle->result()

duration

return the duration of the battle in seconds

$battleDuration = $battle->duration() // 154

trophy change

the amount of trophies gained or lost

$battleTrophies = $battle->trophyChange()

star player

retrieves the star player of the battle. This returns a StarPlayer Object. To see the StarPlayer properties and methods refer to the StarPlayer page.

$starPlayer = $battle->starPlayer()

teams

retrieves the teams that were battling. This returns a TeamsList Object. To see the TeamList properties refer to the TeamList page and the List page.

$teams = $battle->teams() // TeamList

Last updated

Was this helpful?