Overview

Packages

  • Jyxo_Beholder
  • Jyxo_Charset
  • Jyxo_Color
  • Jyxo_Css
  • Jyxo_ErrorHandling
  • Jyxo_FirePhp
  • Jyxo_Gettext
    • Parser
  • Jyxo_Html
  • Jyxo_Input
    • Chain
    • Filter
    • Validator
  • Jyxo_Mail
    • Email
    • Parser
    • Sender
  • Jyxo_Rpc
    • Json
    • Xml
  • Jyxo_Shell
  • Jyxo_SpamFilter
  • Jyxo_Spl
  • Jyxo_String
  • Jyxo_Svn
  • Jyxo_Time
  • Jyxo_Timer
  • Jyxo_Webdav
  • Jyxo_XmlReader
  • PHP

Classes

  • Jyxo_Input_Validator
  • Jyxo_Input_Validator_AbstractValidator
  • Jyxo_Input_Validator_Callback
  • Jyxo_Input_Validator_Equals
  • Jyxo_Input_Validator_InArray
  • Jyxo_Input_Validator_IsArray
  • Jyxo_Input_Validator_IsBankAccountNumber
  • Jyxo_Input_Validator_IsBirthNumber
  • Jyxo_Input_Validator_IsCompanyId
  • Jyxo_Input_Validator_IsCountryCode
  • Jyxo_Input_Validator_IsDate
  • Jyxo_Input_Validator_IsDateTime
  • Jyxo_Input_Validator_IsEmail
  • Jyxo_Input_Validator_IsIban
  • Jyxo_Input_Validator_IsInt
  • Jyxo_Input_Validator_IsIpV4
  • Jyxo_Input_Validator_IsIpV6
  • Jyxo_Input_Validator_IsNumeric
  • Jyxo_Input_Validator_IsPhone
  • Jyxo_Input_Validator_IsTaxId
  • Jyxo_Input_Validator_IsUrl
  • Jyxo_Input_Validator_IsZipCode
  • Jyxo_Input_Validator_LessThan
  • Jyxo_Input_Validator_NotEmpty
  • Jyxo_Input_Validator_Regex
  • Jyxo_Input_Validator_StringLengthBetween
  • Jyxo_Input_Validator_StringLengthGreaterThan
  • Jyxo_Input_Validator_StringLengthLessThan
  • Jyxo_Input_Validator_Upload

Interfaces

  • Jyxo_Input_Validator_ErrorMessage
  • Jyxo_Input_ValidatorInterface

Exceptions

  • Jyxo_Input_Validator_Exception
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
 1: <?php
 2: 
 3: /**
 4:  * Jyxo PHP Library
 5:  *
 6:  * LICENSE
 7:  *
 8:  * This source file is subject to the new BSD license that is bundled
 9:  * with this package in the file license.txt.
10:  * It is also available through the world-wide-web at this URL:
11:  * https://github.com/jyxo/php/blob/master/license.txt
12:  */
13: 
14: /**
15:  * Validates string length to be greater than the given length.
16:  *
17:  * @category Jyxo
18:  * @package Jyxo_Input
19:  * @subpackage Validator
20:  * @copyright Copyright (c) 2005-2011 Jyxo, s.r.o.
21:  * @license https://github.com/jyxo/php/blob/master/license.txt
22:  * @author Jan Pěček
23:  */
24: class Jyxo_Input_Validator_StringLengthGreaterThan extends Jyxo_Input_Validator_AbstractValidator
25: {
26:     /**
27:      * Minimal string length.
28:      *
29:      * @var integer
30:      */
31:     protected $min;
32: 
33:     /**
34:      * Constructor.
35:      *
36:      * @param integer $min Minimal string length (value length must be greater)
37:      */
38:     public function __construct($min)
39:     {
40:         $this->setMin($min);
41:     }
42: 
43:     /**
44:      * Sets the minimal string length.
45:      *
46:      * @param integer $min Minimal string length
47:      * @return Jyxo_Input_Validator_StringLengthGreaterThan
48:      * @throws InvalidArgumentException If the minimal length is negative
49:      */
50:     public function setMin($min)
51:     {
52:         $min = (int) $min;
53: 
54:         if ($min < 0) {
55:             throw new InvalidArgumentException('Length of string must be greater than zero.');
56:         }
57: 
58:         $this->min = $min;
59: 
60:         return $this;
61:     }
62: 
63:     /**
64:      * Returns the minimal string length.
65:      *
66:      * @return integer
67:      */
68:     public function getMin()
69:     {
70:         return $this->min;
71:     }
72: 
73:     /**
74:      * Validates a value.
75:      *
76:      * @param mixed $value Input value
77:      * @return boolean
78:      */
79:     public function isValid($value)
80:     {
81:         return mb_strlen((string) $value, 'utf-8') > $this->getMin();
82:     }
83: 
84: }
85: 
Jyxo PHP Library API documentation generated by ApiGen 2.3.0