PHP Class UploadBehavior, uploadpack

Enables users to easily add file uploading and necessary validation rules PHP versions 4 and 5 Copyright 2010, Jose Diaz-Gonzalez Licensed under The MIT License Redistributions of files must retain the above copyright notice.
Inheritance: extends ModelBehavior
Afficher le fichier Open project: szajbus/uploadpack Class Usage Examples

Méthodes publiques

Méthode Description
afterDelete ( Model $model )
afterSave ( Model $model, $create, $options = [] )
attachmentContentType ( Model $model, $value, $contentTypes, $options = [] )
attachmentMaxSize ( Model $model, $value, $max, $options = [] )
attachmentMinSize ( Model $model, $value, $min, $options = [] )
attachmentPresence ( Model $model, $value, $options = [] )
beforeDelete ( Model $model, $cascade = true )
beforeSave ( Model $model, $options = [] )
beforeValidate ( Model $model, $options = [] )
interpolate ( $modelName, $modelId, $field, $filename, $style = 'original', $defaults = [] )
maxHeight ( Model $model, $value, $maxHeight, $options = [] )
maxWidth ( Model $model, $value, $maxWidth, $options = [] )
minHeight ( Model $model, $value, $minHeight, $options = [] )
minWidth ( Model $model, $value, $minWidth, $options = [] )
phpUploadError ( Model $model, $value, $uploadErrors = ['UPLOAD_ERR_INI_SIZE', 'UPLOAD_ERR_FORM_SIZE', 'UPLOAD_ERR_PARTIAL', 'UPLOAD_ERR_NO_FILE', 'UPLOAD_ERR_NO_TMP_DIR', 'UPLOAD_ERR_CANT_WRITE', 'UPLOAD_ERR_EXTENSION'], $options = [] )
setup ( Model $model, $settings = [] )

Méthodes protégées

Méthode Description
afterMove ( $file )

Private Methods

Méthode Description
_deleteFiles ( &$model )
_fetchFromUrl ( $url )
_interpolate ( &$model, $field, $filename, $style )
_pathinfo ( $filename )
_prepareToDeleteFiles ( &$model, $field = null, $forceRead = false )
_prepareToWriteFiles ( &$model, $field )
_reset ( )
_resize ( $srcFile, $destFile, $geometry, $quality = 75, $alpha = false )
_validateDimension ( $upload, $mode, $axis, $value, $options )
_writeFiles ( &$model )

Method Details

afterDelete() public méthode

public afterDelete ( Model $model )
$model Model

afterMove() protected méthode

protected afterMove ( $file )

afterSave() public méthode

public afterSave ( Model $model, $create, $options = [] )
$model Model

attachmentContentType() public méthode

public attachmentContentType ( Model $model, $value, $contentTypes, $options = [] )
$model Model

attachmentMaxSize() public méthode

public attachmentMaxSize ( Model $model, $value, $max, $options = [] )
$model Model

attachmentMinSize() public méthode

public attachmentMinSize ( Model $model, $value, $min, $options = [] )
$model Model

attachmentPresence() public méthode

public attachmentPresence ( Model $model, $value, $options = [] )
$model Model

beforeDelete() public méthode

public beforeDelete ( Model $model, $cascade = true )
$model Model

beforeSave() public méthode

public beforeSave ( Model $model, $options = [] )
$model Model

beforeValidate() public méthode

public beforeValidate ( Model $model, $options = [] )
$model Model

interpolate() public static méthode

public static interpolate ( $modelName, $modelId, $field, $filename, $style = 'original', $defaults = [] )

maxHeight() public méthode

public maxHeight ( Model $model, $value, $maxHeight, $options = [] )
$model Model

maxWidth() public méthode

public maxWidth ( Model $model, $value, $maxWidth, $options = [] )
$model Model

minHeight() public méthode

public minHeight ( Model $model, $value, $minHeight, $options = [] )
$model Model

minWidth() public méthode

public minWidth ( Model $model, $value, $minWidth, $options = [] )
$model Model

phpUploadError() public méthode

public phpUploadError ( Model $model, $value, $uploadErrors = ['UPLOAD_ERR_INI_SIZE', 'UPLOAD_ERR_FORM_SIZE', 'UPLOAD_ERR_PARTIAL', 'UPLOAD_ERR_NO_FILE', 'UPLOAD_ERR_NO_TMP_DIR', 'UPLOAD_ERR_CANT_WRITE', 'UPLOAD_ERR_EXTENSION'], $options = [] )
$model Model

setup() public méthode

public setup ( Model $model, $settings = [] )
$model Model