Source for file Zip.php

Documentation is available at Zip.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.  * 郵便番号を1つにまとめます。(ハイフンで結合)
  20.  * 郵便番号はそれぞれ、$foo[0],$foo[1]に格納されている前提です。
  21.  * target属性で指定されたフィールド名に値を格納します。
  22.  *
  23.  * @package teeple.converter
  24.  */
  25. {
  26.     
  27.     /**
  28.      * 変換後の値を格納するプロパティ名
  29.      * @var string 
  30.      */
  31.     public $target;
  32.     
  33.     protected function execute(&$obj$fieldName{
  34.         
  35.         if (Teeple_Util::isBlank($this->target)) {
  36.             throw new Teeple_Exception("targetが指定されていません。");
  37.         }
  38.         
  39.         $value Teeple_Util::getProperty($obj$fieldName);
  40.         if (is_array($value|| count($value!= 2{
  41.             return FALSE;
  42.         }
  43.         
  44.         if ($value[0!= "" && $value[1!= ""{
  45.             $newvalue sprintf("%s-%s"$value[0]$value[1]);
  46.             Teeple_Util::setProperty($obj$this->target$newvalue);
  47.             return TRUE;
  48.         }
  49.         return FALSE;
  50.     }
  51.     
  52. }
  53. ?>

Documentation generated on Mon, 26 Apr 2010 09:00:05 +0900 by phpDocumentor 1.4.3