API Documentation

Zend/Validate/StringLength.php

Show: inherited
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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Validate  
Version
$Id: StringLength.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Validate_StringLength

Package: Zend\Validate

Parent(s)
\Zend_Validate_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

Constant  INVALID = 'stringLengthInvalid'
Constant  TOO_SHORT = 'stringLengthTooShort'
Constant  TOO_LONG = 'stringLengthTooLong'

Properties

Propertyprotectedstring|null  $_encoding= ''

Encoding to use

Details
Type
stringnull
Propertyprotectedinteger|null  $_max= ''

Maximum length

If null, there is no maximum length

Details
Type
integernull
Propertyprotectedarray  $_messageTemplates= 'array( self::INVALID => "Invalid type given. String expected"'

Default valuearray( self::INVALID => "Invalid type given. String expected"Details
Type
array
Propertyprotectedarray  $_messageVariables= 'array( 'min' => '_min''

Default valuearray( 'min' => '_min'Details
Type
array
Propertyprotectedinteger  $_min= ''

Minimum length

Details
Type
integer

Methods

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

Sets validator options

Parameters
Name Type Description
$options integer|array|\Zend_Config
methodpublicgetEncoding( ) : string

Returns the actual encoding

Returns
Type Description
string
methodpublicgetMax( ) : integer|null

Returns the max option

Returns
Type Description
integer|null
methodpublicgetMin( ) : integer

Returns the min option

Returns
Type Description
integer
methodpublicisValid( string $value ) : boolean

Defined by Zend_Validate_Interface

Returns true if and only if the string length of $value is at least the min option and no greater than the max option (when the max option is not null).

Parameters
Name Type Description
$value string
Returns
Type Description
boolean
methodpublicsetEncoding( string $encoding = null ) : \Zend_Validate_StringLength

Sets a new encoding to use

Parameters
Name Type Description
$encoding string
Returns
Type Description
\Zend_Validate_StringLength
methodpublicsetMax( integer|null $max ) : \Zend_Validate_StringLength

Sets the max option

Parameters
Name Type Description
$max integer|null
Returns
Type Description
\Zend_Validate_StringLength Provides a fluent interface
Throws
Exception Description
\Zend_Validate_Exception
methodpublicsetMin( integer $min ) : \Zend_Validate_StringLength

Sets the min option

Parameters
Name Type Description
$min integer
Returns
Type Description
\Zend_Validate_StringLength Provides a fluent interface
Throws
Exception Description
\Zend_Validate_Exception
Documentation was generated by DocBlox 0.15.1.