PHP Класс app\models\Album

Наследование: extends Illuminate\Database\Eloquent\Model
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$casts
$guarded
$hidden

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
generateRandomCoverPath ( string $extension ) : string Generate a random path for the cover image.

Описание методов

artist() публичный Метод

public artist ( )

copyCoverFile() публичный Метод

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

generateCover() публичный Метод

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() публичный статический Метод

Get an album using some provided information.
public static get ( Artist $artist, string $name, boolean $isCompilation = false ) : self
$artist Artist
$name string
$isCompilation boolean
Результат self

getCoverAttribute() публичный Метод

public getCoverAttribute ( $value )

getHasCoverAttribute() публичный Метод

Determine if the current album has a cover.
public getHasCoverAttribute ( ) : boolean
Результат boolean

getInfo() публичный Метод

Get extra information about the album from Last.fm.
public getInfo ( ) : array | false
Результат array | false

getIsCompilationAttribute() публичный Метод

Determine if the album is a compilation.
public getIsCompilationAttribute ( ) : boolean
Результат boolean

getNameAttribute() публичный Метод

This makes sure they are always sane.
public getNameAttribute ( $value ) : string
$value
Результат string

isUnknown() публичный Метод

public isUnknown ( )

setCoverAttribute() публичный Метод

public setCoverAttribute ( $value )

songs() публичный Метод

public songs ( )

writeCoverFile() публичный Метод

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

Описание свойств

$casts защищенное свойство

protected $casts

$guarded защищенное свойство

protected $guarded

$hidden защищенное свойство

protected $hidden