Since: 2023-03-20

class MelonArtist extends Melon implements ArtistInterface

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

Properties

int $id from  Melon
protected Client $client 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, Client|null $client = null, 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, Client|null $client = null, bool $autoParse = true)

Class factory to make Melon instance.

from  Melon
static string|null
emptyToNull(string|null $path)

Infer the default image for Melon as null

from  Melon
int
getId()

Get the artist ID.

string
getName()

Get the artist name.

string|null
getFeaturedImagePath()

Get the featured image path.

string|null
getProfileImagePath()

Get the profile image path.

string|null
getBirth()

Get the birth date.

string|null
getDebut()

Get the debut date.

string|null
getAgency()

Get the agency.

string|null
getGenre()

Get the genre.

Details

at line 21
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 38
__construct(int $id, Client|null $client = null, bool $autoParse = true)

Class constructor.

Parameters

int $id

The id of the class

Client|null $client

HTTP client instance

bool $autoParse

Automatically parse the response

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

Setter for ArrayAccess.

Parameters

mixed $offset
mixed $value

Return Value

void

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

Whether an offset exists

Parameters

mixed $offset

Return Value

bool

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

Unset an offset

Parameters

mixed $offset

Return Value

void

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

Offset to retrieve

Parameters

mixed $offset

Return Value

mixed

in Melon at line 96
static Melon make(int $id, Client|null $client = null, bool $autoParse = true)

Class factory to make Melon instance.

Parameters

int $id

The id of the class

Client|null $client

HTTP client instance

bool $autoParse

Automatically parse the response

Return Value

Melon

in Melon at line 109
static string|null emptyToNull(string|null $path)

Infer the default image for Melon as null

Parameters

string|null $path

The path from Melon.

Return Value

string|null

If it is default image, return null.

Examples

https://cdnimg.melon.co.kr/resource/mobile40/cds/common/image/sns_post_default_500.jpg

at line 56
int getId()

Get the artist ID.

Return Value

int

at line 64
string getName()

Get the artist name.

Return Value

string

at line 72
string|null getFeaturedImagePath()

Get the featured image path.

Return Value

string|null

at line 80
string|null getProfileImagePath()

Get the profile image path.

Return Value

string|null

at line 88
string|null getBirth()

Get the birth date.

Return Value

string|null

at line 96
string|null getDebut()

Get the debut date.

Return Value

string|null

at line 104
string|null getAgency()

Get the agency.

Return Value

string|null

at line 112
string|null getGenre()

Get the genre.

Return Value

string|null