PHP Class Devise\Pages\Fields\Handlers\ImageFieldUpdated

Show file Open project: devisephp/cms Class Usage Examples

Public Methods

Method Description
__construct ( Images $Images, MediaPaths $MediaPaths, Caption $Caption, Framework $Framework ) Constructs a new Image field updated event handler
handle ( Field $field, array $input, $beforeChanges ) : array This is called anytime after we update an image field in devise

Protected Methods

Method Description
createThumbnailOfImage ( Field $field, $input ) : string Create a version of this thumbnail, crops too when $crop is set to true
createVersionOfImage ( Field $field, $input ) : string Create a version of this image, crops too when $crop is set to true
croppedImagePath ( Field $field, $type = 'image' ) : string Creates a cropped versioned copy of this image
resizedImagePath ( Field $field, $width, $height ) : string Create a version of this thumbnail, crops too when $crop is set to true
saveCaption ( $imagePath, array $input ) : string Save or overwrite caption file for image
versionedImagePath ( Field $field ) : string Creates a versioned copy of this image

Method Details

__construct() public method

Constructs a new Image field updated event handler
public __construct ( Images $Images, MediaPaths $MediaPaths, Caption $Caption, Framework $Framework )
$Images Devise\Media\Images\Images
$MediaPaths Devise\Media\MediaPaths
$Caption Devise\Media\Helpers\Caption
$Framework Devise\Support\Framework

createThumbnailOfImage() protected method

Create a version of this thumbnail, crops too when $crop is set to true
protected createThumbnailOfImage ( Field $field, $input ) : string
$field Field
return string

createVersionOfImage() protected method

Create a version of this image, crops too when $crop is set to true
protected createVersionOfImage ( Field $field, $input ) : string
$field Field
return string

croppedImagePath() protected method

Creates a cropped versioned copy of this image
protected croppedImagePath ( Field $field, $type = 'image' ) : string
$field Field
return string

handle() public method

This is called anytime after we update an image field in devise
public handle ( Field $field, array $input, $beforeChanges ) : array
$field Field
$input array
return array

resizedImagePath() protected method

Create a version of this thumbnail, crops too when $crop is set to true
protected resizedImagePath ( Field $field, $width, $height ) : string
$field Field
return string

saveCaption() protected method

Save or overwrite caption file for image
protected saveCaption ( $imagePath, array $input ) : string
$input array
return string

versionedImagePath() protected method

Creates a versioned copy of this image
protected versionedImagePath ( Field $field ) : string
$field Field
return string