Documentation

QueueInterface extends Countable

Provides an interface for managing the queue of a controller.

Table of Contents

Methods

addTrack()  : QueueInterface
Add a track to the queue.
addTracks()  : QueueInterface
Add tracks to the queue.
clear()  : QueueInterface
Remove all tracks from the queue.
getTracks()  : array<string|int, TrackInterface>
Get tracks from the queue.
removeTrack()  : bool
Remove a track from the queue.
removeTracks()  : bool
Remove tracks from the queue.

Methods

addTrack()

Add a track to the queue.

public addTrack(string|UriInterface $track[, int|null $position = null ]) : QueueInterface
Parameters
$track : string|UriInterface

The URI of the track to add, or an object that implements the UriInterface

$position : int|null = null

The position to insert the track in the queue (zero-based), by default the track will be added to the end of the queue

Return values
QueueInterface

addTracks()

Add tracks to the queue.

public addTracks(array<string|int, string>|array<string|int, UriInterface$tracks[, int|null $position = null ]) : QueueInterface
Parameters
$tracks : array<string|int, string>|array<string|int, UriInterface>

An array where each element is either the URI of the tracks to add, or an object that implements the UriInterface

$position : int|null = null

The position to insert the tracks in the queue (zero-based), by default the tracks will be added to the end of the queue

Return values
QueueInterface

getTracks()

Get tracks from the queue.

public getTracks([int $start = 0 ][, int $total = 0 ]) : array<string|int, TrackInterface>
Parameters
$start : int = 0

The zero-based position in the queue to start from

$total : int = 0

The maximum number of tracks to return

Return values
array<string|int, TrackInterface>

removeTrack()

Remove a track from the queue.

public removeTrack(int $position) : bool
Parameters
$position : int

The zero-based position of the track to remove

Return values
bool

removeTracks()

Remove tracks from the queue.

public removeTracks(array<string|int, int> $positions) : bool
Parameters
$positions : array<string|int, int>

The zero-based positions of the tracks to remove

Return values
bool
On this page

Search results