PHP Class app\models\Album

Inheritance: extends Illuminate\Database\Eloquent\Model
Afficher le fichier Open project: phanan/koel Class Usage Examples

Protected Properties

Свойство Type Description
$casts
$guarded
$hidden

Méthodes publiques

Méthode Description
artist ( )
copyCoverFile ( string $srcPath ) Copy a cover file from an existing image on the system.
generateCover ( array $cover ) Generate a cover from provided data.
get ( Artist $artist, string $name, boolean $isCompilation = false ) : self Get an album using some provided information.
getCoverAttribute ( $value )
getHasCoverAttribute ( ) : boolean Determine if the current album has a cover.
getInfo ( ) : array | false Get extra information about the album from Last.fm.
getIsCompilationAttribute ( ) : boolean Determine if the album is a compilation.
getNameAttribute ( $value ) : string Sometimes the tags extracted from getID3 are HTML entity encoded.
isUnknown ( )
setCoverAttribute ( $value )
songs ( )
writeCoverFile ( string $binaryData, string $extension ) Write a cover image file with binary data and update the Album with the new cover file.

Private Methods

Méthode Description
generateRandomCoverPath ( string $extension ) : string Generate a random path for the cover image.

Method Details

artist() public méthode

public artist ( )

copyCoverFile() public méthode

Copy a cover file from an existing image on the system.
public copyCoverFile ( string $srcPath )
$srcPath string The original image's full path.

generateCover() public méthode

Generate a cover from provided data.
public generateCover ( array $cover )
$cover array The cover data in array format, extracted by getID3. For example: [ 'data' => '', 'image_mime' => 'image/png', 'image_width' => 512, 'image_height' => 512, 'imagetype' => 'PNG', // not always present 'picturetype' => 'Other', 'description' => '', 'datalength' => 7627, ]

get() public static méthode

Get an album using some provided information.
public static get ( Artist $artist, string $name, boolean $isCompilation = false ) : self
$artist Artist
$name string
$isCompilation boolean
Résultat self

getCoverAttribute() public méthode

public getCoverAttribute ( $value )

getHasCoverAttribute() public méthode

Determine if the current album has a cover.
public getHasCoverAttribute ( ) : boolean
Résultat boolean

getInfo() public méthode

Get extra information about the album from Last.fm.
public getInfo ( ) : array | false
Résultat array | false

getIsCompilationAttribute() public méthode

Determine if the album is a compilation.
public getIsCompilationAttribute ( ) : boolean
Résultat boolean

getNameAttribute() public méthode

This makes sure they are always sane.
public getNameAttribute ( $value ) : string
$value
Résultat string

isUnknown() public méthode

public isUnknown ( )

setCoverAttribute() public méthode

public setCoverAttribute ( $value )

songs() public méthode

public songs ( )

writeCoverFile() public méthode

Write a cover image file with binary data and update the Album with the new cover file.
public writeCoverFile ( string $binaryData, string $extension )
$binaryData string
$extension string The file extension

Property Details

$casts protected_oe property

protected $casts

$guarded protected_oe property

protected $guarded

$hidden protected_oe property

protected $hidden