Ignore:
Timestamp:
2007/08/27 10:29:27 (17 years ago)
Author:
nanasess
Message:

リファクタリング

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php

    r15272 r15361  
    1818 * @package DB 
    1919 * @author LOCKON CO.,LTD. 
    20  * @version $Id$ 
     20 * @version $Id:SC_DB_DBFactory_MYSQL.php 15267 2007-08-09 12:31:52Z nanasess $ 
    2121 */ 
    2222class SC_DB_DBFactory_MYSQL extends SC_DB_DBFactory { 
     
    105105 
    106106    /** 
     107     * View の WHERE 句を置換する. 
     108     * 
     109     * @param string $target 置換対象の文字列 
     110     * @param string $where 置換する文字列 
     111     * @param array $arrval WHERE 句の要素の配列 
     112     * @param string $option SQL 文の追加文字列 
     113     * @return string 置換後の SQL 文 
     114     */ 
     115    function sfViewWhere($target, $where = "", $arrval = array(), $option = ""){ 
     116 
     117        $arrWhere = split("[?]", $where); 
     118        $where_tmp = " WHERE " . $arrWhere[0]; 
     119        for($i = 1; $i < count($arrWhere); $i++){ 
     120            $where_tmp .= SC_Utils_Ex::sfQuoteSmart($arrval[$i - 1]) . $arrWhere[$i]; 
     121        } 
     122        $arrWhere = $this->getWhereConverter(); 
     123        $arrWhere[$target] = $where_tmp . " " . $option; 
     124        return $arrWhere[$target]; 
     125    } 
     126 
     127    /** 
    107128     * SQL の中の View の存在をチェックする. 
    108129     * 
     
    167188        $changesql = eregi_replace("( RANDOM)", " RAND", $sql); 
    168189        return $changesql; 
    169     } 
    170  
    171     /** 
    172      * View の WHERE 句を置換する. 
    173      * 
    174      * @access private 
    175      * @param string $target 置換対象の文字列 
    176      * @param string $where 置換する文字列 
    177      * @param array $arrval WHERE 句の要素の配列 
    178      * @param string $option SQL 文の追加文字列 
    179      * @return string 置換後の SQL 文 
    180      */ 
    181     function sfViewWhere($target, $where = "", $arrval = array(), $option = ""){ 
    182         global $arrViewWhere; 
    183         $arrWhere = split("[?]", $where); 
    184         $where_tmp = " WHERE " . $arrWhere[0]; 
    185         for($i = 1; $i < count($arrWhere); $i++){ 
    186             $where_tmp .= SC_Utils_Ex::sfQuoteSmart($arrval[$i - 1]) . $arrWhere[$i]; 
    187         } 
    188         $arrViewWhere[$target] = $where_tmp . " " . $option; 
    189190    } 
    190191 
Note: See TracChangeset for help on using the changeset viewer.