Documentation

Song
in package

Table of Contents

$diff_bass  : mixed
$diff_drums  : mixed
$diff_guitar  : mixed
$diff_keys  : mixed
$diff_probass  : mixed
$diff_proguitar  : mixed
$diff_prokeys  : mixed
$diff_vocals  : mixed
$song_id  : mixed
$DB  : mixed
__construct()  : mixed
Song class
album_art()  : mixed
album_art_hires()  : mixed
badge()  : mixed
checkID()  : mixed
comments()  : mixed
data()  : bool
Returns all data for this song IMPORTANT! This does NOT set properties and does not require properties to be set
fileData()  : array<string|int, mixed>
Returns data for all available files for this song File data is based on file data model
fileurl()  : mixed
fixFileDataModel()  : array<string|int, mixed>
Fixes fields name for public consumption The files table is inherited from the legacy DB which had Italian field names, plus other fields need renaming to avoid conflicts and we need to unserialize This method takes care of converting them
fixFileDataModelForProperties()  : array<string|int, mixed>
Fixes fields for public property setting When we set some fields as property, they need some formatting
gameFormats()  : mixed
init()  : bool
Inits all data for this song by setting all properties IMPORTANT! _construct does not take care of this, it only sets basic properties
is2x()  : mixed
isRhythm()  : mixed
owned_file()  : mixed
owned_song()  : mixed
publicFiles()  : mixed
rhythmOn()  : mixed
songData()  : array<string|int, mixed>
Returns data for this song based on song data model
tableData()  : mixed
tableDataDL()  : mixed
tableDataProfile()  : mixed
upload_date()  : mixed
url()  : mixed
_modelFileData()  : array<string|int, mixed>
File data model Stores all fields from the DB that become properties We can also serve this fields in an object or array
_modelSongData()  : array<string|int, mixed>
Song data model Stores all fields from the DB that become properties We can also serve this fields in an object or array

Properties

$diff_bass

public mixed $diff_bass

$diff_drums

public mixed $diff_drums

$diff_guitar

public mixed $diff_guitar

$diff_keys

public mixed $diff_keys

$diff_probass

public mixed $diff_probass

$diff_proguitar

public mixed $diff_proguitar

$diff_prokeys

public mixed $diff_prokeys

$diff_vocals

public mixed $diff_vocals

$song_id

public mixed $song_id

Methods

__construct()

Song class

public __construct(mixed $record_id[, mixed $all = false ]) : mixed
Parameters
$record_id : mixed
$all : mixed = false
Tags
record_id

string : This can either be the file ID or the song slug Use the file ID prefixed with a | (for example |1841) to create a new song object starting from a file

all

string|bool OPTIONAL : Can either be a boolean, if used to force display of all songs, or the author currently browsing

Return values
mixed

album_art()

public album_art() : mixed
Return values
mixed

album_art_hires()

public album_art_hires() : mixed
Return values
mixed

badge()

public badge(mixed $fileid) : mixed
Parameters
$fileid : mixed
Return values
mixed

checkID()

public checkID(mixed $myrecord_id) : mixed
Parameters
$myrecord_id : mixed
Return values
mixed

comments()

public comments() : mixed
Return values
mixed

data()

Returns all data for this song IMPORTANT! This does NOT set properties and does not require properties to be set

public data([mixed $options = false ]) : bool
Parameters
$options : mixed = false
Tags
options

array :

what

string : See _modelSongData

data_type

string : song|file|full 'bare' is not available here because class Song is not involved in serving bare data : @bare array : the minimum package for data_type, used for data_type file when no song data is requested

Return values
bool

fileData()

Returns data for all available files for this song File data is based on file data model

public fileData(mixed $song_id[, mixed $options = false ]) : array<string|int, mixed>
Parameters
$song_id : mixed
$options : mixed = false
Tags
song_id

int : DB ID for the song

options

all bool : If TRUE show all files, including hidden

options

author string : author shortname, used to decide whether we can show a song or not, based on ownership

options

canEdit bool : used to decide whether we can show a song or not, based on privileges

options

what string : See _modelFileData

Return values
array<string|int, mixed>

fileurl()

public fileurl(mixed $file_id) : mixed
Parameters
$file_id : mixed
Return values
mixed

fixFileDataModel()

Fixes fields name for public consumption The files table is inherited from the legacy DB which had Italian field names, plus other fields need renaming to avoid conflicts and we need to unserialize This method takes care of converting them

public static fixFileDataModel(mixed $myrow) : array<string|int, mixed>
Parameters
$myrow : mixed
Tags
myrow

array : Data array from fileData

Return values
array<string|int, mixed>

fixFileDataModelForProperties()

Fixes fields for public property setting When we set some fields as property, they need some formatting

public static fixFileDataModelForProperties(mixed $myrow, mixed $song_data) : array<string|int, mixed>
Parameters
$myrow : mixed
$song_data : mixed
Tags
myrow

array : Data array from fileData

Return values
array<string|int, mixed>

gameFormats()

public gameFormats() : mixed
Return values
mixed

init()

Inits all data for this song by setting all properties IMPORTANT! _construct does not take care of this, it only sets basic properties

public init([mixed $options = false ]) : bool
Parameters
$options : mixed = false
Tags
options

what string : See _modelSongData

Return values
bool

is2x()

public is2x([mixed $file_id = false ]) : mixed
Parameters
$file_id : mixed = false
Return values
mixed

isRhythm()

public isRhythm([mixed $file_id = false ]) : mixed
Parameters
$file_id : mixed = false
Return values
mixed

owned_file()

public owned_file(mixed $file_id, mixed $author) : mixed
Parameters
$file_id : mixed
$author : mixed
Return values
mixed

owned_song()

public owned_song(mixed $song_id, mixed $author) : mixed
Parameters
$song_id : mixed
$author : mixed
Return values
mixed

publicFiles()

public publicFiles() : mixed
Return values
mixed

rhythmOn()

public rhythmOn([mixed $file_id = false ]) : mixed
Parameters
$file_id : mixed = false
Return values
mixed

songData()

Returns data for this song based on song data model

public songData([mixed $options = false ]) : array<string|int, mixed>
Parameters
$options : mixed = false
Tags
options

array :

what

string : See _modelSongData

Return values
array<string|int, mixed>

tableData()

public tableData([mixed $options = false ]) : mixed
Parameters
$options : mixed = false
Return values
mixed

tableDataDL()

public tableDataDL(mixed $song_id[, mixed $options = false ]) : mixed
Parameters
$song_id : mixed
$options : mixed = false
Return values
mixed

tableDataProfile()

public tableDataProfile([mixed $options = false ]) : mixed
Parameters
$options : mixed = false
Return values
mixed

upload_date()

public upload_date(mixed $file_id) : mixed
Parameters
$file_id : mixed
Return values
mixed

url()

public url(mixed $song_id) : mixed
Parameters
$song_id : mixed
Return values
mixed

_modelFileData()

File data model Stores all fields from the DB that become properties We can also serve this fields in an object or array

private _modelFileData([mixed $options = false ]) : array<string|int, mixed>
Parameters
$options : mixed = false
Tags
options

what string : What to serve We can implement a filtering option to only return some fields Right now they are all tagged as "all" but we can tag them to only serve more relevant fields and not crowd the return package

Return values
array<string|int, mixed>

_modelSongData()

Song data model Stores all fields from the DB that become properties We can also serve this fields in an object or array

private _modelSongData([mixed $options = false ]) : array<string|int, mixed>
Parameters
$options : mixed = false
Tags
options

what string : What to serve We can implement a filtering option to only return some fields Right now they are all tagged as "all" but we can tag them to only serve more relevant fields and not crowd the return package

Return values
array<string|int, mixed>

Search results