Since: 2023-03-20

class WaterMelon

Fetch all information about a song, song's albums and song's artists from the melon.com API.

Traits

Factory class for creating traits.

Properties

MelonSong $song
$album

$var MelonAlbum $album Melon album.

Melon[] $artists

Methods

static Makeable
make(...$arguments)

Create a new instance.

from  Makeable
__construct(int $songid)

Constructor.

parse()

To get a instance of the WaterMelon class after fetching information about a song from the melon.com API.

getSong()

Getter to get a information about a song.

getAlbum()

Getter to get a information about a album.

array
getArtists()

Getter to get a information about artists.

Details

in Makeable at line 15
static Makeable make(...$arguments)

Create a new instance.

Parameters

...$arguments

Return Value

Makeable

at line 36
__construct(int $songid)

Constructor.

Parameters

int $songid

Melon song ID.

at line 52
WaterMelon parse()

To get a instance of the WaterMelon class after fetching information about a song from the melon.com API.

Return Value

WaterMelon

at line 69
MelonSong getSong()

Getter to get a information about a song.

Return Value

MelonSong

Examples

WaterMelon::make(35945927)->getSong();

at line 79
MelonAlbum getAlbum()

Getter to get a information about a album.

Return Value

MelonAlbum

Examples

WaterMelon::make(35945927)->getAlbum();

at line 91
array getArtists()

Getter to get a information about artists.

Return Value

array

Examples

WaterMelon::make(35945927)->getSong();