Ignore:
Timestamp:
2012/01/06 19:54:03 (12 years ago)
Author:
kotani
Message:

Merge from version-2_11-dev

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/helper/SC_Helper_DB.php

    r21328 r21390  
    9999     * @param string $where データを検索する WHERE 句 
    100100     * @param string $dsn データソース名 
    101      * @param string $sql データの追加を行う場合の SQL文 
    102      * @param bool $add データの追加も行う場合 true 
     101     * @param string $sql @deprecated データの追加を行う場合の SQL文 
     102     * @param bool $add @deprecated データの追加も行う場合 true 
    103103     * @return bool データが存在する場合 true, データの追加に成功した場合 true, 
    104104     *               $add == false で, データが存在しない場合 false 
     
    109109 
    110110        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    111         $count = $objQuery->count($table_name, $where, $arrval); 
    112  
    113         if($count > 0) { 
    114             $ret = true; 
    115         } else { 
    116             $ret = false; 
    117         } 
     111        $exists = $objQuery->exists($table_name, $where, $arrval); 
     112 
    118113        // データを追加する 
    119         if(!$ret && $add) { 
     114        if(!$exists && $add) { 
    120115            $objQuery->exec($sql); 
    121116        } 
     
    158153     * 
    159154     * @return int 
     155     * @deprecated 
    160156     */ 
    161157    function sfGetBasisCount() { 
     
    163159 
    164160        return $objQuery->count("dtb_baseinfo"); 
     161    } 
     162 
     163    /** 
     164     * 基本情報の登録有無を取得する 
     165     * 
     166     * @return boolean 有無 
     167     */ 
     168    function sfGetBasisExists() { 
     169        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     170 
     171        return $objQuery->exists('dtb_baseinfo'); 
    165172    } 
    166173 
     
    14311438        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    14321439        $where = 'product_id = ? AND del_flg = 0 AND class_combination_id IS NOT NULL'; 
    1433         $count = $objQuery->count('dtb_products_class', $where, array($product_id)); 
    1434  
    1435         return $count >= 1; 
     1440        $exists = $objQuery->exists('dtb_products_class', $where, array($product_id)); 
     1441 
     1442        return $exists; 
    14361443    } 
    14371444} 
Note: See TracChangeset for help on using the changeset viewer.