Since: 2023-03-20

class SongNullResource extends Resource

Song resource with null for mapping from melon.com.

Properties

Melon $melon from  Resource
protected array $container from  Resource

Methods

array
toArray()

To get resource as array.

__construct(Melon $melon)

Constructor.

from  Resource
mixed
__get(mixed $name)

Reading data from inaccessible (protected or private) or non-existing properties.

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

ArrayAccess implementation.

from  Resource
bool
offsetExists(mixed $offset)

ArrayAccess implementation.

from  Resource
void
offsetUnset(mixed $offset)

ArrayAccess implementation.

from  Resource
mixed
offsetGet(mixed $offset)

ArrayAccess implementation.

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

Infer the default image for Melon as null

from  Resource
make(MelonSong $melonSong)

Create a new SongNullResource instance.

Details

at line 19
array toArray()

To get resource as array.

Return Value

array

in Resource at line 31
__construct(Melon $melon)

Constructor.

Parameters

Melon $melon

Melon class instance

in Resource at line 41
mixed __get(mixed $name)

Reading data from inaccessible (protected or private) or non-existing properties.

Parameters

mixed $name

Return Value

mixed

in Resource at line 49
void offsetSet(mixed $offset, mixed $value)

ArrayAccess implementation.

Parameters

mixed $offset
mixed $value

Return Value

void

in Resource at line 61
bool offsetExists(mixed $offset)

ArrayAccess implementation.

Parameters

mixed $offset

Return Value

bool

in Resource at line 69
void offsetUnset(mixed $offset)

ArrayAccess implementation.

Parameters

mixed $offset

Return Value

void

in Resource at line 77
mixed offsetGet(mixed $offset)

ArrayAccess implementation.

Parameters

mixed $offset

Return Value

mixed

in Resource at line 90
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 32
static SongNullResource make(MelonSong $melonSong)

Create a new SongNullResource instance.

Parameters

MelonSong $melonSong

Return Value

SongNullResource