PHP 클래스 app\models\File

상속: extends NeoEloquent
파일 보기 프로젝트 열기: phanan/koel 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$getID3 getID\getID3 The getID3 object, for ID3 tag reading.
$hash string This value is unique, and can be used to query a Song record.
$mtime integer The file's last modified time.
$path string The file's path.
$song Song The song model that's associated with this file.
$splFileInfo SplFileInf\SplFileInfo The SplFileInfo object of the file.
$syncError string The last parsing error text, if any.

공개 메소드들

메소드 설명
__construct ( string | SplFileInf\SplFileInfo $path, getID\getID3 $getID3 = null ) Construct our File object.
getGetID3 ( ) : getID\getID3
getHash ( string $path ) : string Get a unique hash from a file path.
getInfo ( ) : array | void Get all applicable ID3 info from the file.
getPath ( ) : string
getSyncError ( ) : syncError Get the last parsing error's text.
isChanged ( ) : boolean Determine if the file is changed (its Song record is found, but the timestamp is different).
isNew ( ) : boolean Determine if the file is new (its Song record can't be found in the database).
isNewOrChanged ( ) : boolean Determine if the file is new or changed.
setGetID3 ( getID\getID3 $getID3 = null )
sync ( array $tags, boolean $force = false ) : boolean | Song Sync the song with all available media info against the database.

비공개 메소드들

메소드 설명
getCoverFileUnderSameDirectory ( ) : string | false Issue #380.

메소드 상세

__construct() 공개 메소드

Upon construction, we'll set the path, hash, and associated Song object (if any).
public __construct ( string | SplFileInf\SplFileInfo $path, getID\getID3 $getID3 = null )
$path string | SplFileInf\SplFileInfo Either the file's path, or a SplFileInfo object
$getID3 getID\getID3 A getID3 object for DI (and better performance)

getGetID3() 공개 메소드

public getGetID3 ( ) : getID\getID3
리턴 getID\getID3

getHash() 공개 정적인 메소드

Get a unique hash from a file path.
public static getHash ( string $path ) : string
$path string
리턴 string

getInfo() 공개 메소드

Get all applicable ID3 info from the file.
public getInfo ( ) : array | void
리턴 array | void

getPath() 공개 메소드

public getPath ( ) : string
리턴 string

getSyncError() 공개 메소드

Get the last parsing error's text.
public getSyncError ( ) : syncError
리턴 syncError

isChanged() 공개 메소드

Determine if the file is changed (its Song record is found, but the timestamp is different).
public isChanged ( ) : boolean
리턴 boolean

isNew() 공개 메소드

Determine if the file is new (its Song record can't be found in the database).
public isNew ( ) : boolean
리턴 boolean

isNewOrChanged() 공개 메소드

Determine if the file is new or changed.
public isNewOrChanged ( ) : boolean
리턴 boolean

setGetID3() 공개 메소드

public setGetID3 ( getID\getID3 $getID3 = null )
$getID3 getID\getID3

sync() 공개 메소드

Sync the song with all available media info against the database.
public sync ( array $tags, boolean $force = false ) : boolean | Song
$tags array The (selective) tags to sync (if the song exists)
$force boolean Whether to force syncing, even if the file is unchanged
리턴 boolean | Song A Song object on success, true if file exists but is unmodified, or false on an error.

프로퍼티 상세

$getID3 보호되어 있는 프로퍼티

The getID3 object, for ID3 tag reading.
protected getID3,getID $getID3
리턴 getID\getID3

$hash 보호되어 있는 프로퍼티

This value is unique, and can be used to query a Song record.
protected string $hash
리턴 string

$mtime 보호되어 있는 프로퍼티

The file's last modified time.
protected int $mtime
리턴 integer

$path 보호되어 있는 프로퍼티

The file's path.
protected string $path
리턴 string

$song 보호되어 있는 프로퍼티

The song model that's associated with this file.
protected Song,app\models $song
리턴 Song

$splFileInfo 보호되어 있는 프로퍼티

The SplFileInfo object of the file.
protected SplFileInfo,SplFileInf $splFileInfo
리턴 SplFileInf\SplFileInfo

$syncError 보호되어 있는 프로퍼티

The last parsing error text, if any.
protected string $syncError
리턴 string