ImageFileModel Class Reference

Inheritance diagram for ImageFileModel:
FileModel Item CustomFieldsModel RedBeanModel BeanModel ObservableComponent

Public Member Functions

 getImageCachePath ($shouldGetThumbnail=false)
 getImageCacheFileName ()
 createImageCache ($shouldCreateThumbnail=false)

Static Public Member Functions

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

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 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 getByFileName ( fileName  )  [static]

Get the model by the fileName

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

Definition at line 54 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 65 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 85 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 101 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 116 of file ImageFileModel.php.

getImageCacheFileName (  ) 

Get the cache model file name

Returns:
string The file name

Definition at line 125 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 134 of file ImageFileModel.php.

createCacheDirIfNotExists (  )  [protected]

Create the filesystem dir where cached models will be stored

Definition at line 146 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 159 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 169 of file ImageFileModel.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Tue May 23 07:10:25 2017