Validate/File/FilesSize.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Validate  
Version
$Id$  

\Zend_Validate_File_FilesSize

Package: Zend_Validate
Validator for the size of all files which will be validated in sum
Parent(s)
\Zend_Validate_File_Size < \Zend_Validate_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  TOO_BIG = 'fileFilesSizeTooBig'
Const
string Error constants  
>VConstant  TOO_SMALL = 'fileFilesSizeTooSmall'
>VConstant  NOT_READABLE = 'fileFilesSizeNotReadable'

Properties

>VPropertyprotectedarray $_files
Internal file array
Details
Type
array
>VPropertyprotectedarray $_messageTemplates = array(self::TOO_BIG => "All files in sum should have a maximum size of '%max%' but '%size%' were detected", self::TOO_SMALL => "All files in sum should have a minimum size of '%min%' but '%size%' were detected", self::NOT_READABLE => "One or more files can not be read")

Error message templates

Default valuearray(self::TOO_BIG => "All files in sum should have a maximum size of '%max%' but '%size%' were detected", self::TOO_SMALL => "All files in sum should have a minimum size of '%min%' but '%size%' were detected", self::NOT_READABLE => "One or more files can not be read")Details
Type
array

Methods

methodpublic__construct(integer | array | \Zend_Config $options) : void

Sets validator options

Min limits the used diskspace for all files, when used with max=null it is the maximum filesize It also accepts an array with the keys 'min' and 'max'
Parameters
NameTypeDescription
$optionsinteger | array | \Zend_Config

Options for this validator

methodpublicisValid(string | array $value, array $file = null) : boolean

Defined by Zend_Validate_Interface

Returns true if and only if the disk usage of all files is at least min and not bigger than max (when max is not null).
Parameters
NameTypeDescription
$valuestring | array

Real file to check for size

$filearray

File data from Zend_File_Transfer

Returns
TypeDescription
boolean
Documentation was generated by phpDocumentor 2.2.0 .