PHP Class Andrew13\Cabinet\CabinetUpload

Inheritance: extends Illuminate\Database\Eloquent\Model
显示文件 Open project: andrewelkins/cabinet

Public Properties

Property Type Description
$app

Protected Properties

Property Type Description
$dateFolderPath

Public Methods

Method Description
__construct ( array $attributes = [] ) Create a new CabinetUpload instance.
children ( ) : Illuminate\Database\Eloquent\Relations\HasMany Get children uploads
cleanPath ( $path )
generateThumbnails ( $folder, $file )
getBasename ( $file )
getUploadFolder ( $date = null ) : string Get upload path with date folders
process ( Symfony\Component\HttpFoundation\File\UploadedFile $file )
resolveFileName ( string $folder, Symfony\Component\HttpFoundation\File\UploadedFile $file, boolean $enableObfuscation = true ) : array Resolve whether the file exists and if it already does, change the file name.
upload ( Symfony\Component\HttpFoundation\File\UploadedFile &$file ) : array Upload a file.
user ( ) : User Get the uploads owner.
verifyImageType ( Symfony\Component\HttpFoundation\File\UploadedFile $file ) : boolean Checks the upload vs the upload types in the config.
verifyUploadType ( Symfony\Component\HttpFoundation\File\UploadedFile $file ) Checks the upload vs the upload types in the config.

Method Details

__construct() public method

Create a new CabinetUpload instance.
public __construct ( array $attributes = [] )
$attributes array

children() public method

Get children uploads
public children ( ) : Illuminate\Database\Eloquent\Relations\HasMany
return Illuminate\Database\Eloquent\Relations\HasMany

cleanPath() public method

public cleanPath ( $path )

generateThumbnails() public method

public generateThumbnails ( $folder, $file )

getBasename() public method

public getBasename ( $file )

getUploadFolder() public method

Get upload path with date folders
public getUploadFolder ( $date = null ) : string
$date
return string

process() public method

public process ( Symfony\Component\HttpFoundation\File\UploadedFile $file )
$file Symfony\Component\HttpFoundation\File\UploadedFile

resolveFileName() public method

Resolve whether the file exists and if it already does, change the file name.
public resolveFileName ( string $folder, Symfony\Component\HttpFoundation\File\UploadedFile $file, boolean $enableObfuscation = true ) : array
$folder string
$file Symfony\Component\HttpFoundation\File\UploadedFile
$enableObfuscation boolean
return array

upload() public method

Handles folder creation.
public upload ( Symfony\Component\HttpFoundation\File\UploadedFile &$file ) : array
$file Symfony\Component\HttpFoundation\File\UploadedFile
return array

user() public method

Get the uploads owner.
public user ( ) : User
return User

verifyImageType() public method

Checks the upload vs the upload types in the config.
public verifyImageType ( Symfony\Component\HttpFoundation\File\UploadedFile $file ) : boolean
$file Symfony\Component\HttpFoundation\File\UploadedFile
return boolean

verifyUploadType() public method

Checks the upload vs the upload types in the config.
public verifyUploadType ( Symfony\Component\HttpFoundation\File\UploadedFile $file )
$file Symfony\Component\HttpFoundation\File\UploadedFile

Property Details

$app public_oe static_oe property

public static $app

$dateFolderPath protected_oe property

protected $dateFolderPath