Source for file Length.php

Documentation is available at Length.php

  1. <?php
  2. /**
  3.  * Teeple2 - PHP5 Web Application Framework inspired by Seasar2
  4.  *
  5.  * PHP versions 5
  6.  *
  7.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  8.  * that is available through the world-wide-web at the following URI:
  9.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  10.  * the PHP License and are unable to obtain it through the web, please
  11.  * send a note to license@php.net so we can mail you a copy immediately.
  12.  *
  13.  * @package     teeple
  14.  * @author      Mitsutaka Sato <miztaka@gmail.com>
  15.  * @license     http://www.php.net/license/3_0.txt  PHP License 3.0
  16.  */
  17.  
  18. /**
  19.  * 髟キ縺輔r繝√ぉ繝�け縺励∪縺吶€�
  20.  * 繝槭Ν繝√ヰ繧、繝医b1譁�ュ励→縺励※謨ー縺医∪縺吶€�
  21.  *
  22.  * @package teeple.validator
  23.  */
  24. {
  25.  
  26.     public $minlength;
  27.     public $maxlength;
  28.     
  29.     /**
  30.      * 繧ィ繝ゥ繝シ繝。繝�そ繝シ繧ク縺ョ蠑墓焚縺ォ貂。縺吶�繝ュ繝代ユ繧」蜷�
  31.      * @var array 
  32.      */
  33.     public $args = array('minlength','maxlength');
  34.     
  35.     protected function execute($obj$fieldName{
  36.         
  37.         $value $this->getTargetValue($obj$fieldName);
  38.         if (Teeple_Util::isBlank($value)) {
  39.             return TRUE;
  40.         }
  41.         
  42.         if (Teeple_Util::isBlank($this->minlength&& $this->minlength > mb_strlen($value)) {
  43.             return FALSE;
  44.         }
  45.         
  46.         if (Teeple_Util::isBlank($this->maxlength&& $this->maxlength < mb_strlen($value)) {
  47.             return FALSE;
  48.         }
  49.  
  50.         return TRUE;
  51.     }
  52.     
  53. }
  54. ?>

Documentation generated on Mon, 26 Apr 2010 08:59:51 +0900 by phpDocumentor 1.4.3