Melon
abstract class Melon implements ArrayAccess
Abstract class for WaterMelon classes.
Properties
| int | $id | ||
| protected Client | $client | ||
| protected array | $response |
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.
void
offsetSet(mixed $offset, mixed $value)
Setter for ArrayAccess.
bool
offsetExists(mixed $offset)
Whether an offset exists
void
offsetUnset(mixed $offset)
Unset an offset
mixed
offsetGet(mixed $offset)
Offset to retrieve
static Melon
make(int $id, Client|null $client = null, bool $autoParse = true)
Class factory to make Melon instance.
static string|null
emptyToNull(string|null $path)
Infer the default image for Melon as null
Details
at line 29
abstract protected 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.
at line 38
__construct(int $id, Client|null $client = null, bool $autoParse = true)
Class constructor.
at line 56
void
offsetSet(mixed $offset, mixed $value)
Setter for ArrayAccess.
at line 68
bool
offsetExists(mixed $offset)
Whether an offset exists
at line 76
void
offsetUnset(mixed $offset)
Unset an offset
at line 84
mixed
offsetGet(mixed $offset)
Offset to retrieve
at line 96
static Melon
make(int $id, Client|null $client = null, bool $autoParse = true)
Class factory to make Melon instance.
at line 109
static string|null
emptyToNull(string|null $path)
Infer the default image for Melon as null