Ignore:
Timestamp:
2013/06/08 16:35:27 (13 years ago)
Author:
Seasoft
Message:

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.13.0)

  • 主に空白・空白行の調整。もう少し整えたいが、一旦現状コミット。
File:
1 edited

Legend:

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

    r22795 r22856  
    3232class SC_Query 
    3333{ 
    34  
    3534    var $option = ''; 
    3635    var $where = ''; 
     
    5251    function __construct($dsn = '', $force_run = false, $new = false) 
    5352    { 
    54  
    5553        if ($dsn == '') { 
    5654            $dsn = array('phptype'  => DB_TYPE, 
     
    127125            return true; 
    128126        } 
     127 
    129128        return false; 
    130129    } 
     
    156155        $sql = "SELECT CASE WHEN EXISTS($sql_inner) THEN 1 ELSE 0 END"; 
    157156        $res = $this->getOne($sql, $arrWhereVal); 
     157 
    158158        return (bool)$res; 
    159159    } 
     
    172172    { 
    173173        $sqlse = $this->getSql($cols, $from, $where, $arrWhereVal); 
     174 
    174175        return $this->getAll($sqlse, $arrWhereVal, $fetchmode); 
    175176    } 
     
    187188            echo $sql . ";<br />\n"; 
    188189        } 
     190 
    189191        return $sql; 
    190192    } 
     
    256258    function doCallbackAll($cbFunc, $sql, $arrVal = array(), $fetchmode = MDB2_FETCHMODE_ASSOC) 
    257259    { 
    258  
    259260        $sql = $this->dbFactory->sfChangeMySQL($sql); 
    260261 
     
    276277        } 
    277278        $sth->free(); 
     279 
    278280        return $result; 
    279281    } 
     
    289291    function getAll($sql, $arrVal = array(), $fetchmode = MDB2_FETCHMODE_ASSOC) 
    290292    { 
    291  
    292293        $sql = $this->dbFactory->sfChangeMySQL($sql); 
    293294 
     
    361362    { 
    362363        $this->option = $str; 
     364 
    363365        return $this; 
    364366    } 
     
    378380            $this->conn->setLimit($limit, $offset); 
    379381        } 
     382 
    380383        return $this; 
    381384    } 
     
    396399            $this->groupby = 'GROUP BY ' . $str; 
    397400        } 
     401 
    398402        return $this; 
    399403    } 
     
    414418            $this->where = $str; 
    415419        } 
     420 
    416421        return $this; 
    417422    } 
     
    432437            $this->where = $str; 
    433438        } 
     439 
    434440        return $this; 
    435441    } 
     
    448454        $this->where = $where; 
    449455        $this->arrWhereVal = $arrWhereVal; 
     456 
    450457        return $this; 
    451458    } 
     
    466473            $this->order = 'ORDER BY ' . $str; 
    467474        } 
     475 
    468476        return $this; 
    469477    } 
     
    482490            $this->conn->setLimit($limit); 
    483491        } 
     492 
    484493        return $this; 
    485494    } 
     
    498507            $this->conn->setLimit($this->conn->limit, $offset); 
    499508        } 
     509 
    500510        return $this; 
    501511    } 
     
    629639    { 
    630640        $ret = $this->get("MAX($col)", $table, $where, $arrWhereVal); 
     641 
    631642        return $ret; 
    632643    } 
     
    644655    { 
    645656        $ret = $this->get("MIN($col)", $table, $where, $arrWhereVal); 
     657 
    646658        return $ret; 
    647659    } 
     
    661673        // SQL文の実行 
    662674        $ret = $this->getOne($sqlse, $arrWhereVal); 
     675 
    663676        return $ret; 
    664677    } 
     
    673686    function getOne($sql, $arrVal = array()) 
    674687    { 
    675  
    676688        $sql = $this->dbFactory->sfChangeMySQL($sql); 
    677689 
     
    707719    function getRow($col, $table = '', $where = '', $arrWhereVal = array(), $fetchmode = MDB2_FETCHMODE_ASSOC) 
    708720    { 
    709  
    710721        $sql = $this->getSql($col, $table, $where, $arrWhereVal); 
    711722        $sql = $this->dbFactory->sfChangeMySQL($sql); 
     
    779790        } 
    780791        $ret = $this->query($sqlde, $arrWhereVal, false, null, MDB2_PREPARE_MANIP); 
     792 
    781793        return $ret; 
    782794    } 
     
    825837            $this->error("setVal -> createSequence [$seq_name] [$start]"); 
    826838        } 
     839 
    827840        return $ret; 
    828841    } 
     
    842855    function query($n ,$arr = array(), $ignore_err = false, $types = null, $result_types = MDB2_PREPARE_RESULT) 
    843856    { 
    844  
    845857        $n = $this->dbFactory->sfChangeMySQL($n); 
    846858 
     
    869881    { 
    870882        $objManager =& $this->conn->loadModule('Manager'); 
     883 
    871884        return $objManager->listSequences(); 
    872885    } 
     
    891904    { 
    892905        $objManager =& $this->conn->loadModule('Manager'); 
     906 
    893907        return $objManager->listTableFields($table); 
    894908    } 
     
    903917    { 
    904918        $objManager =& $this->conn->loadModule('Manager'); 
     919 
    905920        return $objManager->listTableIndexes($table); 
    906921    } 
     
    918933        $definition = $this->dbFactory->sfGetCreateIndexDefinition($table, $name, $definition); 
    919934        $objManager =& $this->conn->loadModule('Manager'); 
     935 
    920936        return $objManager->createIndex($table, $name, $definition); 
    921937    } 
     
    930946    { 
    931947        $objManager =& $this->conn->loadModule('Manager'); 
     948 
    932949        return $objManager->dropIndex($table, $name); 
    933950    } 
     
    942959    { 
    943960        $objManager =& $this->conn->loadModule('Reverse'); 
     961 
    944962        return $objManager->tableInfo($table, NULL); 
    945963    } 
     
    977995            } 
    978996        } 
     997 
    979998        return $arrResults; 
    980999    } 
     
    9961015            $this->error($msg); 
    9971016        } 
     1017 
    9981018        return $sth; 
    9991019    } 
     
    10091029    function execute(&$sth, $arrVal = array()) 
    10101030    { 
    1011  
    10121031        $arrStartInfo =& $this->lfStartDbTraceLog($sth, $arrVal); 
    10131032        $affected =& $sth->execute((array)$arrVal); 
     
    10201039        } 
    10211040        $this->conn->last_query = stripslashes($sth->query); 
     1041 
    10221042        return $affected; 
    10231043    } 
     
    10741094    function getQueryDefsFields($n ,$arr = array(), $ignore_err = false, $types = null, $result_types = MDB2_PREPARE_RESULT) 
    10751095    { 
    1076  
    10771096        $n = $this->dbFactory->sfChangeMySQL($n); 
    10781097 
     
    11711190    { 
    11721191        $key_str = serialize($dsn); 
     1192 
    11731193        return SC_Query_Ex::$arrPoolInstance[$key_str] = $objThis; 
    11741194    } 
Note: See TracChangeset for help on using the changeset viewer.