Source for file Equal.php

Documentation is available at Equal.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.  * 指定されたプロパティと値が同じかどうかをチェックします。
  20.  *
  21.  * @package teeple.validator
  22.  */
  23. {
  24.  
  25.     public $compareTo;
  26.     
  27.     protected function execute($obj$fieldName{
  28.         
  29.         $value $this->getTargetValue($obj$fieldName);
  30.         if (Teeple_Util::isBlank($value)) {
  31.             return TRUE;
  32.         }
  33.         
  34.         // 比較対象のプロパティを取得
  35.         if (Teeple_Util::isBlank($this->compareTo)) {
  36.             throw new Teeple_Exception("compareToが設定されていません。");
  37.         }
  38.         $value2 $this->getTargetValue($obj$this->compareTo);
  39.         
  40.         return $value === $value2;
  41.     }
  42.     
  43. }
  44. ?>

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