Since: 2023-03-20

class MelonSong extends Melon

Fetches information about a song from the melon.com API.

Properties

int $id from  Melon
protected array $response from  Melon

Methods

array
parse()

Fetches information about a song, a album or a artist from the melon.com API and saves it to $response and returns it.

__construct(int $id, bool $autoParse = true)

Class constructor.

from  Melon
void
offsetSet(mixed $offset, mixed $value)

Setter for ArrayAccess.

from  Melon
bool
offsetExists(mixed $offset)

Whether an offset exists

from  Melon
void
offsetUnset(mixed $offset)

Unset an offset

from  Melon
mixed
offsetGet(mixed $offset)

Offset to retrieve

from  Melon
static Melon
make(int $id, bool $autoParse = true)

Class factory to make Melon instance.

from  Melon

Details

at line 15
array parse()

Fetches information about a song, a album or a artist from the melon.com API and saves it to $response and returns it.

Return Value

array

An array of information about the song, album or artist.

in Melon at line 33
__construct(int $id, bool $autoParse = true)

Class constructor.

Parameters

int $id

The id of the class

bool $autoParse

Automatically parse the response

in Melon at line 45
void offsetSet(mixed $offset, mixed $value)

Setter for ArrayAccess.

Parameters

mixed $offset
mixed $value

Return Value

void

in Melon at line 57
bool offsetExists(mixed $offset)

Whether an offset exists

Parameters

mixed $offset

Return Value

bool

in Melon at line 65
void offsetUnset(mixed $offset)

Unset an offset

Parameters

mixed $offset

Return Value

void

in Melon at line 73
mixed offsetGet(mixed $offset)

Offset to retrieve

Parameters

mixed $offset

Return Value

mixed

in Melon at line 84
static Melon make(int $id, bool $autoParse = true)

Class factory to make Melon instance.

Parameters

int $id

The id of the class

bool $autoParse

Automatically parse the response

Return Value

Melon