PHP Class app\models\Song

Inheritance: extends Illuminate\Database\Eloquent\Model
Mostrar archivo Open project: phanan/koel Class Usage Examples

Protected Properties

Property Type Description
$casts array

Public Methods

Method Description
album ( )
byPath ( string $path ) : Song | null Get a Song record using its path.
contributingArtist ( )
getArtistAttribute ( ) : Artist Get the correct artist of the song.
getFavorites ( User $user, boolean $toArray = false ) : Illuminate\Database\Eloquent\Collection | array Get all songs favored by a user.

Method Details

album() public method

public album ( )

byPath() public static method

Get a Song record using its path.
public static byPath ( string $path ) : Song | null
$path string
return Song | null

contributingArtist() public method

public contributingArtist ( )

getArtistAttribute() public method

If it's part of a compilation, that would be the contributing artist. Otherwise, it's the album artist.
public getArtistAttribute ( ) : Artist
return Artist

getFavorites() public static method

Get all songs favored by a user.
public static getFavorites ( User $user, boolean $toArray = false ) : Illuminate\Database\Eloquent\Collection | array
$user User
$toArray boolean
return Illuminate\Database\Eloquent\Collection | array

Property Details

$casts protected_oe property

protected array $casts
return array