ImageFileModel Class Reference

Inheritance diagram for ImageFileModel:
FileModel Item CustomFieldsModel RedBeanModel BeanModel ObservableComponent

Public Member Functions

 getImageCachePath ($shouldGetThumbnail=false)
 getImageCacheFileName ()
 createImageCache ($shouldCreateThumbnail=false)
 fileTypeValidator ($attribute, $params)
 toggle ($attribute)
 isToggleable ($attribute)
 canDelete ()
 isEditableByCurrentUser ()

Static Public Member Functions

static getDefaultMetadata ()
static getByFileName ($fileName)
static getImageCachePathByFileName ($fileName, $shouldReturnThumbnail)
static getModuleClassName ()

Data Fields

const DEFAULT_THUMBNAIL_HEIGHT = 30
const DEFAULT_THUMBNAIL_WIDTH = 65
const THUMB_FILE_NAME_PREFIX = 'thumb_'
const FILE_NAME_SEPARATOR = '_'

Protected Member Functions

 createCacheDirIfNotExists ()
 isImageCached ($checkThumbnail=false)
 cacheImage ($shouldCacheThumbnail)

Static Protected Member Functions

static translatedAttributeLabels ($language)
static getIdByFileName ($fileName)
static getPathToCachedFiles ()

Detailed Description

Class ImageFileModel Used to store public accessible images

Definition at line 41 of file ImageFileModel.php.


Member Function Documentation

static getDefaultMetadata (  )  [static]

Returns the default meta data for the class. It must be appended to the meta data from the parent model, if any.

Reimplemented from FileModel.

Definition at line 48 of file ImageFileModel.php.

static getByFileName ( fileName  )  [static]

Get the model by the fileName

Parameters:
$fileName The filename of the model
Returns:
The model
Exceptions:
NotSupportedException 

Definition at line 88 of file ImageFileModel.php.

static getIdByFileName ( fileName  )  [static, protected]

Get the id based on the cached model file name

Parameters:
$fileName The fileName of the model
Returns:
int The model id
Exceptions:
NotFoundException 

Definition at line 99 of file ImageFileModel.php.

getImageCachePath ( shouldGetThumbnail = false  ) 

Get the cached model file path

Parameters:
bool $shouldGetThumbnail True if we should return the thumbnail
Returns:
string The path where the cached model is stored

Definition at line 119 of file ImageFileModel.php.

static getImageCachePathByFileName ( fileName,
shouldReturnThumbnail 
) [static]

Get the cached model file path by the file name of the cached model

Parameters:
$fileName The filename of the cached model
$shouldReturnThumbnail True if we should return the thumbnail
Returns:
string The path where the cached model is stored

Definition at line 134 of file ImageFileModel.php.

static getPathToCachedFiles (  )  [static, protected]

Get the path to the directory where we should store cached models

Returns:
string

Definition at line 149 of file ImageFileModel.php.

getImageCacheFileName (  ) 

Get the cache model file name

Returns:
string The file name

Definition at line 158 of file ImageFileModel.php.

createImageCache ( shouldCreateThumbnail = false  ) 

Caches the model in filesystem

Parameters:
bool $shouldCreateThumbnail True if we want to create the cache for thumbnail

Definition at line 167 of file ImageFileModel.php.

createCacheDirIfNotExists (  )  [protected]

Create the filesystem dir where cached models will be stored

Definition at line 179 of file ImageFileModel.php.

isImageCached ( checkThumbnail = false  )  [protected]

Check if the model has cache created on the filesystem

Parameters:
bool $checkThumbnail True if we are chechink the cached thumbail
Returns:
bool True if the cached model is cached

Definition at line 192 of file ImageFileModel.php.

cacheImage ( shouldCacheThumbnail  )  [protected]

Cache the model on the filesystem

Parameters:
$shouldCacheThumbnail True to create the cache for thumbnail of the model

Definition at line 202 of file ImageFileModel.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Mon Oct 14 07:10:58 2019