Moodle  2.2.1
http://www.collinsharper.com
Zend_Validate_File_ImageSize Class Reference
Inheritance diagram for Zend_Validate_File_ImageSize:
Collaboration diagram for Zend_Validate_File_ImageSize:

Public Member Functions

 __construct ($options)
 getImageMin ()
 getImageMax ()
 getImageWidth ()
 getImageHeight ()
 setImageMin ($options)
 setImageMax ($options)
 setImageWidth ($options)
 setImageHeight ($options)
 isValid ($value, $file=null)

Data Fields

const WIDTH_TOO_BIG = 'fileImageSizeWidthTooBig'
const WIDTH_TOO_SMALL = 'fileImageSizeWidthTooSmall'
const HEIGHT_TOO_BIG = 'fileImageSizeHeightTooBig'
const HEIGHT_TOO_SMALL = 'fileImageSizeHeightTooSmall'
const NOT_DETECTED = 'fileImageSizeNotDetected'
const NOT_READABLE = 'fileImageSizeNotReadable'

Protected Member Functions

 _throw ($file, $errorType)

Protected Attributes

 $_messageTemplates
 $_messageVariables
 $_minwidth
 $_maxwidth
 $_minheight
 $_maxheight
 $_width
 $_height

Detailed Description

Definition at line 35 of file ImageSize.php.


Constructor & Destructor Documentation

__construct ( options)

Sets validator options

Accepts the following option keys:

  • minheight
  • minwidth
  • maxheight
  • maxwidth
Parameters:
Zend_Config | array$options
Returns:
void

Definition at line 125 of file ImageSize.php.

Here is the call graph for this function:


Member Function Documentation

_throw ( file,
errorType 
) [protected]

Throws an error of the given type

Parameters:
string$file
string$errorType
Returns:
false

Definition at line 355 of file ImageSize.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the set image height sizes

Returns:
array

Definition at line 191 of file ImageSize.php.

Returns the set maximum image sizes

Returns:
array

Definition at line 171 of file ImageSize.php.

Returns the set minimum image sizes

Returns:
array

Definition at line 161 of file ImageSize.php.

Returns the set image width sizes

Returns:
array

Definition at line 181 of file ImageSize.php.

isValid ( value,
file = null 
)

Defined by Zend_Validate_Interface

Returns true if and only if the imagesize of $value is at least min and not bigger than max

Parameters:
string$valueReal file to check for image size
array$fileFile data from Zend_File_Transfer
Returns:
boolean

Definition at line 308 of file ImageSize.php.

Here is the call graph for this function:

setImageHeight ( options)

Sets the mimimum and maximum image height

Parameters:
array$optionsThe image height dimensions
Returns:
Zend_Validate_File_ImageSize Provides a fluent interface

Definition at line 290 of file ImageSize.php.

Here is the call graph for this function:

setImageMax ( options)

Sets the maximum image size

Parameters:
array$optionsThe maximum image dimensions
Exceptions:
Zend_Validate_ExceptionWhen maxwidth is smaller than minwidth
Zend_Validate_ExceptionWhen maxheight is smaller than minheight
Returns:
Zend_Validate_StringLength Provides a fluent interface

Definition at line 241 of file ImageSize.php.

Here is the caller graph for this function:

setImageMin ( options)

Sets the minimum image size

Parameters:
array$optionsThe minimum image dimensions
Exceptions:
Zend_Validate_ExceptionWhen minwidth is greater than maxwidth
Zend_Validate_ExceptionWhen minheight is greater than maxheight
Returns:
Zend_Validate_File_ImageSize Provides a fluent interface

Definition at line 204 of file ImageSize.php.

Here is the caller graph for this function:

setImageWidth ( options)

Sets the mimimum and maximum image width

Parameters:
array$optionsThe image width dimensions
Returns:
Zend_Validate_File_ImageSize Provides a fluent interface

Definition at line 276 of file ImageSize.php.

Here is the call graph for this function:


Field Documentation

$_height [protected]

Definition at line 111 of file ImageSize.php.

$_maxheight [protected]

Definition at line 97 of file ImageSize.php.

$_maxwidth [protected]

Definition at line 83 of file ImageSize.php.

$_messageTemplates [protected]
Initial value:
 array(
        self::WIDTH_TOO_BIG    => "Maximum allowed width for image '%value%' should be '%maxwidth%' but '%width%' detected",
        self::WIDTH_TOO_SMALL  => "Minimum expected width for image '%value%' should be '%minwidth%' but '%width%' detected",
        self::HEIGHT_TOO_BIG   => "Maximum allowed height for image '%value%' should be '%maxheight%' but '%height%' detected",
        self::HEIGHT_TOO_SMALL => "Minimum expected height for image '%value%' should be '%minheight%' but '%height%' detected",
        self::NOT_DETECTED     => "The size of image '%value%' could not be detected",
        self::NOT_READABLE     => "File '%value%' can not be read",
    )

Reimplemented from Zend_Validate_Abstract.

Definition at line 50 of file ImageSize.php.

$_messageVariables [protected]
Initial value:
 array(
        'minwidth'  => '_minwidth',
        'maxwidth'  => '_maxwidth',
        'minheight' => '_minheight',
        'maxheight' => '_maxheight',
        'width'     => '_width',
        'height'    => '_height'
    )

Reimplemented from Zend_Validate_Abstract.

Definition at line 62 of file ImageSize.php.

$_minheight [protected]

Definition at line 90 of file ImageSize.php.

$_minwidth [protected]

Definition at line 76 of file ImageSize.php.

$_width [protected]

Definition at line 104 of file ImageSize.php.

const HEIGHT_TOO_BIG = 'fileImageSizeHeightTooBig'

Definition at line 42 of file ImageSize.php.

const HEIGHT_TOO_SMALL = 'fileImageSizeHeightTooSmall'

Definition at line 43 of file ImageSize.php.

const NOT_DETECTED = 'fileImageSizeNotDetected'

Definition at line 44 of file ImageSize.php.

const NOT_READABLE = 'fileImageSizeNotReadable'

Definition at line 45 of file ImageSize.php.

const WIDTH_TOO_BIG = 'fileImageSizeWidthTooBig'

string Error constants

Definition at line 40 of file ImageSize.php.

const WIDTH_TOO_SMALL = 'fileImageSizeWidthTooSmall'

Definition at line 41 of file ImageSize.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations