Changeset 21373


Ignore:
Timestamp:
2011/12/24 14:16:59 (12 years ago)
Author:
Seasoft
Message:

#1583 (SC_Query#count 実装を単純に)
#1526 (typo修正・ソース整形・ソースコメントの改善)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/class/SC_Query.php

    r21372 r21373  
    106106 
    107107    /** 
    108      *  エラー判定を行う. 
     108     * エラー判定を行う. 
    109109     * 
    110110     * @deprecated PEAR::isError() を使用して下さい 
     
    126126     * @return integer 件数 
    127127     */ 
    128     function count($table, $where = "", $arrWhereVal = array()) { 
    129         if(strlen($where) <= 0) { 
    130             $sqlse = "SELECT COUNT(*) FROM $table"; 
    131         } else { 
    132             $sqlse = "SELECT COUNT(*) FROM $table WHERE $where"; 
    133         } 
    134         $sqlse = $this->dbFactory->sfChangeMySQL($sqlse); 
    135         return $this->getOne($sqlse, $arrWhereVal); 
     128    function count($table, $where = '', $arrWhereVal = array()) { 
     129        return $this->get('COUNT(*)', $table, $where, $arrWhereVal); 
    136130    } 
    137131 
Note: See TracChangeset for help on using the changeset viewer.