Changeset 19730


Ignore:
Timestamp:
2010/12/16 23:18:05 (13 years ago)
Author:
Seasoft
Message:

#855(SC_Query の #select, #getRow, #getCol, #get, #min, #max の引数順を統一する)

  • SC_Query#getCol を改訂
Location:
branches/version-2_5-dev
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/SC_Product.php

    r19711 r19730  
    586586        $objQuery =& SC_Query::getSingletonInstance(); 
    587587        $objQuery->groupby = 'GROUP BY payment_id HAVING COUNT(payment_id) = ?'; 
    588         $paymentIds = $objQuery->getCol('dtb_payment_options', 'payment_id', 
     588        $paymentIds = $objQuery->getCol('payment_id', 'dtb_payment_options', 
    589589                                        'product_class_id IN (' . implode(', ', array_pad(array(), $size, '?')) . ')', 
    590590                                        array_merge($productClassIds, array($size)), 
  • branches/version-2_5-dev/data/class/SC_Query.php

    r19729 r19730  
    609609     * @return array SQL の実行結果の配列 
    610610     */ 
    611     function getCol($table, $col, $where = "", $arrval = array()) { 
     611    function getCol($col, $table, $where = "", $arrval = array()) { 
    612612        $sql = $this->getSql($col, $table, $where); 
    613613        $sql = $this->dbFactory->sfChangeMySQL($sql); 
  • branches/version-2_5-dev/data/class/helper/SC_Helper_CSV.php

    r19670 r19730  
    170170            // カテゴリID 
    171171            if (in_array('category_id', $arrOutputCols)) { 
    172                 $row['category_id'] = $objQuery->getCol("dtb_product_categories", 
    173                                   "category_id", 
    174                                   "product_id = ?", 
    175                                   array($row['product_id'])); 
     172                $row['category_id'] = $objQuery->getCol( 
     173                    "category_id", 
     174                    "dtb_product_categories", 
     175                    "product_id = ?", 
     176                    array($row['product_id']) 
     177                ); 
    176178            } 
    177179 
  • branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php

    r19729 r19730  
    799799                $objQuery =& SC_Query::getSingletonInstance(); 
    800800                $where = "product_id = ?"; 
    801                 $category_id = $objQuery->getCol("dtb_product_categories", "category_id", "product_id = ?", array($product_id)); 
     801                $category_id = $objQuery->getCol("category_id", "dtb_product_categories", "product_id = ?", array($product_id)); 
    802802                $this->g_category_id = $category_id; 
    803803            } else { 
     
    17231723                $objQuery =& SC_Query::getSingletonInstance(); 
    17241724                $where = "product_id = ?"; 
    1725                 $maker_id = $objQuery->getCol("dtb_products", "maker_id", "product_id = ?", array($product_id)); 
     1725                $maker_id = $objQuery->getCol("maker_id", "dtb_products", "product_id = ?", array($product_id)); 
    17261726                $this->g_maker_id = $maker_id; 
    17271727            } else { 
  • branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Product.php

    r19728 r19730  
    388388 
    389389        // カテゴリID を取得 
    390         $arrRet[0]['category_id'] = $objQuery->getCol("dtb_product_categories", 
    391                                                       "category_id", 
    392                                                       "product_id = ?", 
    393         array($product_id)); 
     390        $arrRet[0]['category_id'] = $objQuery->getCol( 
     391            "category_id", 
     392            "dtb_product_categories", 
     393            "product_id = ?", 
     394            array($product_id) 
     395        ); 
    394396        //編集時に規格IDが変わってしまうのを防ぐために規格が登録されていなければ規格IDを取得する 
    395397        if (!$objDb->sfHasProductClass($_POST['product_id'])) { 
  • branches/version-2_5-dev/data/include/module.inc

    r18820 r19730  
    5858 
    5959$_objQuery = new SC_Query; 
    60 $_arrModuleCode = $_objQuery->getCol('dtb_module', 'module_code'); 
     60$_arrModuleCode = $_objQuery->getCol('module_code', 'dtb_module'); 
    6161 
    6262if (is_array($_arrModuleCode)) { 
  • branches/version-2_5-dev/test/class/SC_Query_Test.php

    r18820 r19730  
    154154 
    155155        $this->expected = array(1, 2); 
    156         $this->actual = $this->objQuery->getCol("test_table", "column1", "id < ?",  array(3)); 
     156        $this->actual = $this->objQuery->getCol("column1", "test_table", "id < ?",  array(3)); 
    157157 
    158158        $this->verify(); 
Note: See TracChangeset for help on using the changeset viewer.