Ignore:
Timestamp:
2013/08/26 15:52:37 (11 years ago)
Author:
m_uehara
Message:

#2348 r23116 - r23125 をマージ

File:
1 edited

Legend:

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

    r22960 r23126  
    3232{ 
    3333    /** ルートカテゴリ取得フラグ */ 
    34     var $g_root_on; 
     34    public $g_root_on; 
    3535 
    3636    /** ルートカテゴリID */ 
    37     var $g_root_id; 
     37    public $g_root_id; 
    3838 
    3939    /** 選択中カテゴリ取得フラグ */ 
    40     var $g_category_on; 
     40    public $g_category_on; 
    4141 
    4242    /** 選択中カテゴリID */ 
    43     var $g_category_id; 
     43    public $g_category_id; 
    4444 
    4545    /** 
     
    5050     * カラムの生成も行う場合は, $col_type も必須となる. 
    5151     * 
    52      * @param string $$tableName テーブル名 
    53      * @param string $column_name カラム名 
    54      * @param string $col_type カラムのデータ型 
    55      * @param string $dsn データソース名 
    56      * @param bool $add カラムの作成も行う場合 true 
    57      * @return bool カラムが存在する場合とカラムの生成に成功した場合 true, 
     52     * @param  string $$tableName テーブル名 
     53     * @param  string $column_name カラム名 
     54     * @param  string $col_type    カラムのデータ型 
     55     * @param  string $dsn        データソース名 
     56     * @param  bool   $add        カラムの作成も行う場合 true 
     57     * @return bool   カラムが存在する場合とカラムの生成に成功した場合 true, 
    5858     *               テーブルが存在しない場合 false, 
    5959     *               引数 $add == false でカラムが存在しない場合 false 
    6060     */ 
    61     function sfColumnExists($tableName, $colName, $colType = '', $dsn = '', $add = false) 
     61    public function sfColumnExists($tableName, $colName, $colType = '', $dsn = '', $add = false) 
    6262    { 
    6363        $dbFactory = SC_DB_DBFactory_Ex::getInstance(); 
     
    8787    } 
    8888 
    89     function sfColumnAdd($tableName, $colName, $colType) { 
     89    public function sfColumnAdd($tableName, $colName, $colType) 
     90    { 
    9091        $objQuery =& SC_Query_Ex::getSingletonInstance($dsn); 
    9192 
     
    9697     * データの存在チェックを行う. 
    9798     * 
    98      * @param string $tableName テーブル名 
    99      * @param string $where データを検索する WHERE 句 
    100      * @param array $arrWhereVal WHERE句のプレースホルダ値 
    101      * @return bool データが存在する場合 true, データの追加に成功した場合 true, 
     99     * @param  string $tableName  テーブル名 
     100     * @param  string $where      データを検索する WHERE 句 
     101     * @param  array $arrWhereVal WHERE句のプレースホルダ値 
     102     * @return bool   データが存在する場合 true, データの追加に成功した場合 true, 
    102103     *               $add == false で, データが存在しない場合 false 
    103104     */ 
    104     function sfDataExists($tableName, $where, $arrWhereVal) 
     105    public function sfDataExists($tableName, $where, $arrWhereVal) 
    105106    { 
    106107        $dbFactory = SC_DB_DBFactory_Ex::getInstance(); 
     
    124125     * 2回目以降はキャッシュされた結果を使用する. 
    125126     * 
    126      * @param boolean $force 強制的にDB取得するか 
    127      * @return array 店舗基本情報の配列 
    128      */ 
    129     function sfGetBasisData($force = false) 
     127     * @param  boolean $force 強制的にDB取得するか 
     128     * @return array   店舗基本情報の配列 
     129     */ 
     130    public function sfGetBasisData($force = false) 
    130131    { 
    131132        static $arrData = null; 
     
    143144     * 基本情報のキャッシュデータを取得する 
    144145     * 
    145      * @param boolean $generate キャッシュファイルが無い時、DBのデータを基にキャッシュを生成するか 
    146      * @return array 店舗基本情報の配列 
    147      */ 
    148     function sfGetBasisDataCache($generate = false) 
     146     * @param  boolean $generate キャッシュファイルが無い時、DBのデータを基にキャッシュを生成するか 
     147     * @return array   店舗基本情報の配列 
     148     */ 
     149    public function sfGetBasisDataCache($generate = false) 
    149150    { 
    150151        // テーブル名 
     
    179180     * @return bool キャッシュデータファイル生成結果 
    180181     */ 
    181     function sfCreateBasisDataCache() 
     182    public function sfCreateBasisDataCache() 
    182183    { 
    183184        // テーブル名 
     
    199200        // ファイルを閉じる 
    200201        fclose($handle); 
    201         if ( $res === false) { 
     202        if ($res === false) { 
    202203            // ファイル生成失敗 
    203204            return false; 
     
    213214     * @deprecated 
    214215     */ 
    215     function sfGetBasisCount() 
     216    public function sfGetBasisCount() 
    216217    { 
    217218        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    225226     * @return boolean 有無 
    226227     */ 
    227     function sfGetBasisExists() 
     228    public function sfGetBasisExists() 
    228229    { 
    229230        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    233234 
    234235    /* 選択中のアイテムのルートカテゴリIDを取得する */ 
    235     function sfGetRootId() 
     236    public function sfGetRootId() 
    236237    { 
    237238        if (!$this->g_root_on) { 
     
    264265     * 受注番号、最終ポイント、加算ポイント、利用ポイントから「オーダー前ポイント」を取得する 
    265266     * 
    266      * @param integer $order_id 受注番号 
    267      * @param integer $use_point 利用ポイント 
    268      * @param integer $add_point 加算ポイント 
    269      * @param integer $order_status 対応状況 
    270      * @return array オーダー前ポイントの配列 
    271      */ 
    272     function sfGetRollbackPoint($order_id, $use_point, $add_point, $order_status) 
     267     * @param  integer $order_id    受注番号 
     268     * @param  integer $use_point    利用ポイント 
     269     * @param  integer $add_point    加算ポイント 
     270     * @param  integer $order_status 対応状況 
     271     * @return array   オーダー前ポイントの配列 
     272     */ 
     273    public function sfGetRollbackPoint($order_id, $use_point, $add_point, $order_status) 
    273274    { 
    274275        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    300301     * カテゴリツリーの取得を行う. 
    301302     * 
    302      * @param integer $parent_category_id 親カテゴリID 
    303      * @param bool $count_check 登録商品数のチェックを行う場合 true 
    304      * @return array カテゴリツリーの配列 
    305      */ 
    306     function sfGetCatTree($parent_category_id, $count_check = false) 
     303     * @param  integer $parent_category_id 親カテゴリID 
     304     * @param  bool    $count_check        登録商品数のチェックを行う場合 true 
     305     * @return array   カテゴリツリーの配列 
     306     */ 
     307    public function sfGetCatTree($parent_category_id, $count_check = false) 
    307308    { 
    308309        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    351352     * @see sfGetCatTree() 
    352353     */ 
    353     function findTree(&$arrTree, $parent, &$result) 
     354    public function findTree(&$arrTree, $parent, &$result) 
    354355    { 
    355356        if ($result[count($result) - 1]['parent_category_id'] === 0) { 
     
    372373     * カテゴリツリーの取得を複数カテゴリで行う. 
    373374     * 
    374      * @param integer $product_id 商品ID 
    375      * @param bool $count_check 登録商品数のチェックを行う場合 true 
    376      * @return array カテゴリツリーの配列 
    377      */ 
    378     function sfGetMultiCatTree($product_id, $count_check = false) 
     375     * @param  integer $product_id 商品ID 
     376     * @param  bool    $count_check 登録商品数のチェックを行う場合 true 
     377     * @return array   カテゴリツリーの配列 
     378     */ 
     379    public function sfGetMultiCatTree($product_id, $count_check = false) 
    379380    { 
    380381        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    422423     * 親カテゴリを連結した文字列を取得する. 
    423424     * 
    424      * @param integer $category_id カテゴリID 
    425      * @return string 親カテゴリを連結した文字列 
    426      */ 
    427     function sfGetCatCombName($category_id) 
     425     * @param  integer $category_id カテゴリID 
     426     * @return string  親カテゴリを連結した文字列 
     427     */ 
     428    public function sfGetCatCombName($category_id) 
    428429    { 
    429430        // 商品が属するカテゴリIDを縦に取得 
     
    448449     * 指定したカテゴリIDの大カテゴリを取得する. 
    449450     * 
    450      * @param integer $category_id カテゴリID 
    451      * @return array 指定したカテゴリIDの大カテゴリ 
    452      */ 
    453     function sfGetFirstCat($category_id) 
     451     * @param  integer $category_id カテゴリID 
     452     * @return array   指定したカテゴリIDの大カテゴリ 
     453     */ 
     454    public function sfGetFirstCat($category_id) 
    454455    { 
    455456        // 商品が属するカテゴリIDを縦に取得 
     
    472473     * $products_check:true商品登録済みのものだけ取得する 
    473474     * 
    474      * @param string $addwhere 追加する WHERE 句 
    475      * @param bool $products_check 商品の存在するカテゴリのみ取得する場合 true 
    476      * @param string $head カテゴリ名のプレフィックス文字列 
    477      * @return array カテゴリツリーの配列 
    478      */ 
    479     function sfGetCategoryList($addwhere = '', $products_check = false, $head = CATEGORY_HEAD) 
     475     * @param  string $addwhere      追加する WHERE 句 
     476     * @param  bool  $products_check 商品の存在するカテゴリのみ取得する場合 true 
     477     * @param  string $head          カテゴリ名のプレフィックス文字列 
     478     * @return array  カテゴリツリーの配列 
     479     */ 
     480    public function sfGetCategoryList($addwhere = '', $products_check = false, $head = CATEGORY_HEAD) 
    480481    { 
    481482        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    515516     * 親カテゴリの Value=0 を対象とする 
    516517     * 
    517      * @param bool $parent_zero 親カテゴリの Value=0 の場合 true 
     518     * @param  bool $parent_zero 親カテゴリの Value=0 の場合 true 
    518519     * @return array カテゴリツリーの配列 
    519520     */ 
    520     function sfGetLevelCatList($parent_zero = true) 
     521    public function sfGetLevelCatList($parent_zero = true) 
    521522    { 
    522523        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    563564     * 選択中の商品のカテゴリを取得する. 
    564565     * 
    565      * @param integer $product_id プロダクトID 
    566      * @param integer $category_id カテゴリID 
    567      * @return array 選択中の商品のカテゴリIDの配列 
    568      * 
    569      */ 
    570     function sfGetCategoryId($product_id, $category_id = 0, $closed = false) 
     566     * @param  integer $product_id プロダクトID 
     567     * @param  integer $category_id カテゴリID 
     568     * @return array   選択中の商品のカテゴリIDの配列 
     569     * 
     570     */ 
     571    public function sfGetCategoryId($product_id, $category_id = 0, $closed = false) 
    571572    { 
    572573        if ($closed) { 
     
    579580        if (SC_Utils_Ex::sfIsInt($category_id) && $category_id != 0 && SC_Helper_DB_Ex::sfIsRecord('dtb_category','category_id', $category_id)) { 
    580581            $category_id = array($category_id); 
    581         } else if (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && SC_Helper_DB_Ex::sfIsRecord('dtb_products','product_id', $product_id, $status)) { 
     582        } elseif (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && SC_Helper_DB_Ex::sfIsRecord('dtb_products','product_id', $product_id, $status)) { 
    582583            $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    583584            $category_id = $objQuery->getCol('category_id', 'dtb_product_categories', 'product_id = ?', array($product_id)); 
     
    593594     * 商品をカテゴリの先頭に追加する. 
    594595     * 
    595      * @param integer $category_id カテゴリID 
    596      * @param integer $product_id プロダクトID 
     596     * @param  integer $category_id カテゴリID 
     597     * @param  integer $product_id プロダクトID 
    597598     * @return void 
    598599     */ 
    599     function addProductBeforCategories($category_id, $product_id) 
     600    public function addProductBeforCategories($category_id, $product_id) 
    600601    { 
    601602        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    615616     * 商品をカテゴリの末尾に追加する. 
    616617     * 
    617      * @param integer $category_id カテゴリID 
    618      * @param integer $product_id プロダクトID 
     618     * @param  integer $category_id カテゴリID 
     619     * @param  integer $product_id プロダクトID 
    619620     * @return void 
    620621     */ 
    621     function addProductAfterCategories($category_id, $product_id) 
     622    public function addProductAfterCategories($category_id, $product_id) 
    622623    { 
    623624        $sqlval = array('category_id' => $category_id, 
     
    648649     * 商品をカテゴリから削除する. 
    649650     * 
    650      * @param integer $category_id カテゴリID 
    651      * @param integer $product_id プロダクトID 
     651     * @param  integer $category_id カテゴリID 
     652     * @param  integer $product_id プロダクトID 
    652653     * @return void 
    653654     */ 
    654     function removeProductByCategories($category_id, $product_id) 
     655    public function removeProductByCategories($category_id, $product_id) 
    655656    { 
    656657        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    662663     * 商品カテゴリを更新する. 
    663664     * 
    664      * @param array $arrCategory_id 登録するカテゴリIDの配列 
    665      * @param integer $product_id プロダクトID 
     665     * @param  array  $arrCategory_id 登録するカテゴリIDの配列 
     666     * @param  integer $product_id    プロダクトID 
    666667     * @return void 
    667668     */ 
    668     function updateProductCategories($arrCategory_id, $product_id) 
     669    public function updateProductCategories($arrCategory_id, $product_id) 
    669670    { 
    670671        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    695696     * 
    696697     * 
    697      * @param SC_Query $objQuery SC_Query インスタンス 
    698      * @param boolean $is_force_all_count 全カテゴリの集計を強制する場合 true 
     698     * @param  SC_Query $objQuery          SC_Query インスタンス 
     699     * @param  boolean $is_force_all_count 全カテゴリの集計を強制する場合 true 
    699700     * @return void 
    700701     */ 
    701     function sfCountCategory($objQuery = NULL, $is_force_all_count = false) 
     702    public function sfCountCategory($objQuery = NULL, $is_force_all_count = false) 
    702703    { 
    703704        $objProduct = new SC_Product_Ex(); 
     
    783784                $objQuery->commit(); 
    784785            } 
     786 
    785787            return; 
    786788        } 
     
    793795            $sqlval = array(); 
    794796            $sqlval['create_date'] = 'CURRENT_TIMESTAMP'; 
    795             $sqlval['product_count'] = (string)$arrNew[$cid]; 
     797            $sqlval['product_count'] = (string) $arrNew[$cid]; 
    796798            if ($sqlval['product_count'] =='') { 
    797                 $sqlval['product_count'] = (string)'0'; 
     799                $sqlval['product_count'] = (string) '0'; 
    798800            } 
    799801            if (isset($arrOld[$cid])) { 
     
    854856            $sqlval['product_count'] = $count; 
    855857            if ($sqlval['product_count'] =='') { 
    856                 $sqlval['product_count'] = (string)'0'; 
     858                $sqlval['product_count'] = (string) '0'; 
    857859            } 
    858860            $ret = $objQuery->update('dtb_category_total_count', $sqlval, 'category_id = ?', array($cid)); 
     
    871873     * 子IDの配列を返す. 
    872874     * 
    873      * @param string $table テーブル名 
    874      * @param string $pid_name 親ID名 
    875      * @param string $id_name ID名 
    876      * @param integer $id ID 
     875     * @param string  $table    テーブル名 
     876     * @param string  $pid_name 親ID名 
     877     * @param string  $id_name ID名 
     878     * @param integer $id       ID 
    877879     * @param array 子ID の配列 
    878880     */ 
    879     function sfGetChildsID($table, $pid_name, $id_name, $id) 
     881    public function sfGetChildsID($table, $pid_name, $id_name, $id) 
    880882    { 
    881883        $arrRet = $this->sfGetChildrenArray($table, $pid_name, $id_name, $id); 
     
    887889     * 階層構造のテーブルから子ID配列を取得する. 
    888890     * 
    889      * @param string $table テーブル名 
    890      * @param string $pid_name 親ID名 
    891      * @param string $id_name ID名 
    892      * @param integer $id ID番号 
    893      * @return array 子IDの配列 
    894      */ 
    895     function sfGetChildrenArray($table, $pid_name, $id_name, $id) 
     891     * @param  string  $table    テーブル名 
     892     * @param  string $pid_name 親ID名 
     893     * @param  string  $id_name ID名 
     894     * @param  integer $id      ID番号 
     895     * @return array   子IDの配列 
     896     */ 
     897    public function sfGetChildrenArray($table, $pid_name, $id_name, $id) 
    896898    { 
    897899        $arrChildren = array(); 
     
    909911     * 親ID直下の子IDを全て取得する. 
    910912     * 
    911      * @param array $arrData 親カテゴリの配列 
    912      * @param string $pid_name 親ID名 
    913      * @param string $id_name ID名 
    914      * @param array $arrPID 親IDの配列 
    915      * @return array 子IDの配列 
    916      */ 
    917     function sfGetChildrenArraySub($table, $pid_name, $id_name, $arrPID) 
     913     * @param  array  $arrData 親カテゴリの配列 
     914     * @param  string $pid_name 親ID名 
     915     * @param  string $id_name ID名 
     916     * @param  array  $arrPID  親IDの配列 
     917     * @return array  子IDの配列 
     918     */ 
     919    public function sfGetChildrenArraySub($table, $pid_name, $id_name, $arrPID) 
    918920    { 
    919921        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    929931     * 所属する全ての階層の親IDを配列で返す. 
    930932     * 
    931      * @param SC_Query $objQuery SC_Query インスタンス 
    932      * @param string $table テーブル名 
    933      * @param string $pid_name 親ID名 
    934      * @param string $id_name ID名 
    935      * @param integer $id ID 
    936      * @return array 親IDの配列 
    937      */ 
    938     function sfGetParents($table, $pid_name, $id_name, $id) 
     933     * @param  SC_Query $objQuery SC_Query インスタンス 
     934     * @param  string   $table    テーブル名 
     935     * @param  string  $pid_name 親ID名 
     936     * @param  string   $id_name ID名 
     937     * @param  integer  $id      ID 
     938     * @return array    親IDの配列 
     939     */ 
     940    public function sfGetParents($table, $pid_name, $id_name, $id) 
    939941    { 
    940942        $arrRet = SC_Helper_DB_Ex::sfGetParentsArray($table, $pid_name, $id_name, $id); 
     
    946948     * 階層構造のテーブルから親ID配列を取得する. 
    947949     * 
    948      * @param string $table テーブル名 
    949      * @param string $pid_name 親ID名 
    950      * @param string $id_name ID名 
    951      * @param integer $id ID 
    952      * @return array 親IDの配列 
    953      */ 
    954     function sfGetParentsArray($table, $pid_name, $id_name, $id) 
     950     * @param  string  $table    テーブル名 
     951     * @param  string $pid_name 親ID名 
     952     * @param  string  $id_name ID名 
     953     * @param  integer $id      ID 
     954     * @return array   親IDの配列 
     955     */ 
     956    public function sfGetParentsArray($table, $pid_name, $id_name, $id) 
    955957    { 
    956958        $arrParents = array(); 
     
    968970 
    969971    /* 子ID所属する親IDを取得する */ 
    970     function sfGetParentsArraySub($table, $pid_name, $id_name, $child) 
     972    public function sfGetParentsArraySub($table, $pid_name, $id_name, $child) 
    971973    { 
    972974        if (SC_Utils_Ex::isBlank($child)) { 
     
    985987     * カテゴリから商品を検索する場合のWHERE文と値を返す. 
    986988     * 
    987      * @param integer $category_id カテゴリID 
    988      * @return array 商品を検索する場合の配列 
    989      */ 
    990     function sfGetCatWhere($category_id) 
     989     * @param  integer $category_id カテゴリID 
     990     * @return array   商品を検索する場合の配列 
     991     */ 
     992    public function sfGetCatWhere($category_id) 
    991993    { 
    992994        // 子カテゴリIDの取得 
     
    10011003     * SELECTボックス用リストを作成する. 
    10021004     * 
    1003      * @param string $table テーブル名 
    1004      * @param string $keyname プライマリーキーのカラム名 
    1005      * @param string $valname データ内容のカラム名 
    1006      * @param string $where WHERE句 
    1007      * @param array $arrWhereVal プレースホルダ 
    1008      * @return array SELECT ボックス用リストの配列 
    1009      */ 
    1010     function sfGetIDValueList($table, $keyname, $valname, $where = '', $arrVal = array()) 
     1005     * @param  string $table      テーブル名 
     1006     * @param  string $keyname    プライマリーキーのカラム名 
     1007     * @param  string $valname    データ内容のカラム名 
     1008     * @param  string $where      WHERE句 
     1009     * @param  array $arrWhereVal プレースホルダ 
     1010     * @return array  SELECT ボックス用リストの配列 
     1011     */ 
     1012    public function sfGetIDValueList($table, $keyname, $valname, $where = '', $arrVal = array()) 
    10111013    { 
    10121014        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    10291031     * ランキングを上げる. 
    10301032     * 
    1031      * @param string $table テーブル名 
    1032      * @param string $colname カラム名 
    1033      * @param string|integer $id テーブルのキー 
    1034      * @param string $andwhere SQL の AND 条件である WHERE 句 
     1033     * @param  string         $table    テーブル名 
     1034     * @param  string         $colname カラム名 
     1035     * @param  string|integer $id      テーブルのキー 
     1036     * @param  string        $andwhere SQL の AND 条件である WHERE 句 
    10351037     * @return void 
    10361038     */ 
    1037     function sfRankUp($table, $colname, $id, $andwhere = '') 
     1039    public function sfRankUp($table, $colname, $id, $andwhere = '') 
    10381040    { 
    10391041        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    10811083     * ランキングを下げる. 
    10821084     * 
    1083      * @param string $table テーブル名 
    1084      * @param string $colname カラム名 
    1085      * @param string|integer $id テーブルのキー 
    1086      * @param string $andwhere SQL の AND 条件である WHERE 句 
     1085     * @param  string         $table    テーブル名 
     1086     * @param  string         $colname カラム名 
     1087     * @param  string|integer $id      テーブルのキー 
     1088     * @param  string        $andwhere SQL の AND 条件である WHERE 句 
    10871089     * @return void 
    10881090     */ 
    1089     function sfRankDown($table, $colname, $id, $andwhere = '') 
     1091    public function sfRankDown($table, $colname, $id, $andwhere = '') 
    10901092    { 
    10911093        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    11321134     * 指定順位へ移動する. 
    11331135     * 
    1134      * @param string $tableName テーブル名 
    1135      * @param string $keyIdColumn キーを保持するカラム名 
    1136      * @param string|integer $keyId キーの値 
    1137      * @param integer $pos 指定順位 
    1138      * @param string $where SQL の AND 条件である WHERE 句 
     1136     * @param  string         $tableName  テーブル名 
     1137     * @param  string        $keyIdColumn キーを保持するカラム名 
     1138     * @param  string|integer $keyId      キーの値 
     1139     * @param  integer        $pos        指定順位 
     1140     * @param  string         $where      SQL の AND 条件である WHERE 句 
    11391141     * @return void 
    11401142     */ 
    1141     function sfMoveRank($tableName, $keyIdColumn, $keyId, $pos, $where = '') 
     1143    public function sfMoveRank($tableName, $keyIdColumn, $keyId, $pos, $where = '') 
    11421144    { 
    11431145        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    11821184     * 指定位置が1番下へ移動なら、newRankは1 
    11831185     * 
    1184      * @param int $position 指定された位置 
    1185      * @param int $maxRank 現在のランク最大値 
     1186     * @param  int $position 指定された位置 
     1187     * @param  int $maxRank 現在のランク最大値 
    11861188     * @return int $newRank DBに登録するRANK値 
    11871189     */ 
    1188     function getNewRank($position, $maxRank) { 
     1190    public function getNewRank($position, $maxRank) 
     1191    { 
    11891192        if ($position > $maxRank) { 
    11901193            $newRank = 1; 
    1191         } else if ($position < 1) { 
     1194        } elseif ($position < 1) { 
    11921195            $newRank = $maxRank; 
    11931196        } else { 
     
    12011204     * 指定した順位の商品から移動させる商品までのrankを1つずらす 
    12021205     * 
    1203      * @param int $newRank 
    1204      * @param int $oldRank 
    1205      * @param object $objQuery 
    1206      * @param string $where 
     1206     * @param  int    $newRank 
     1207     * @param  int    $oldRank 
     1208     * @param  object $objQuery 
     1209     * @param  string $where 
    12071210     * @return boolean 
    12081211     */ 
    1209     function moveOtherItemRank($newRank, $oldRank, &$objQuery, $tableName, $addWhere) { 
     1212    public function moveOtherItemRank($newRank, $oldRank, &$objQuery, $tableName, $addWhere) 
     1213    { 
    12101214        $sqlval = array(); 
    12111215        $arrRawSql = array(); 
     
    12181222            $arrRawSql['rank'] = 'rank - 1'; 
    12191223            $arrWhereVal = array($oldRank + 1, $newRank); 
    1220         } else if ($newRank < $oldRank) { 
     1224        } elseif ($newRank < $oldRank) { 
    12211225            //位置を下げる場合、他の商品の位置を1つ上げる(ランクを1上げる) 
    12221226            $arrRawSql['rank'] = 'rank + 1'; 
     
    12351239     * レコードごと削除する場合は、$deleteをtrueにする 
    12361240     * 
    1237      * @param string $table テーブル名 
    1238      * @param string $colname カラム名 
    1239      * @param string|integer $id テーブルのキー 
    1240      * @param string $andwhere SQL の AND 条件である WHERE 句 
    1241      * @param bool $delete レコードごと削除する場合 true, 
     1241     * @param string         $table    テーブル名 
     1242     * @param string         $colname カラム名 
     1243     * @param string|integer $id       テーブルのキー 
     1244     * @param string         $andwhere SQL の AND 条件である WHERE 句 
     1245     * @param bool           $delete  レコードごと削除する場合 true, 
    12421246     *                     レコードごと削除しない場合 false 
    12431247     * @return void 
    12441248     */ 
    1245     function sfDeleteRankRecord($table, $colname, $id, $andwhere = '', 
     1249    public function sfDeleteRankRecord($table, $colname, $id, $andwhere = '', 
    12461250                                $delete = false) { 
    12471251        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    12851289     * 親IDの配列を元に特定のカラムを取得する. 
    12861290     * 
    1287      * @param SC_Query $objQuery SC_Query インスタンス 
    1288      * @param string $table テーブル名 
    1289      * @param string $id_name ID名 
    1290      * @param string $col_name カラム名 
    1291      * @param array $arrId IDの配列 
    1292      * @return array 特定のカラムの配列 
    1293      */ 
    1294     function sfGetParentsCol($objQuery, $table, $id_name, $col_name, $arrId) 
     1291     * @param  SC_Query $objQuery SC_Query インスタンス 
     1292     * @param  string   $table    テーブル名 
     1293     * @param  string   $id_name ID名 
     1294     * @param  string  $col_name カラム名 
     1295     * @param  array    $arrId    IDの配列 
     1296     * @return array    特定のカラムの配列 
     1297     */ 
     1298    public function sfGetParentsCol($objQuery, $table, $id_name, $col_name, $arrId) 
    12951299    { 
    12961300        $col = $col_name; 
     
    13171321     * ※この関数って、どこからも呼ばれていないのでは?? 
    13181322     * 
    1319      * @param SC_Query $objQuery SC_Query インスタンス 
    1320      * @param string $table テーブル名 
    1321      * @param string $id_name ID名 
    1322      * @param string $cat_name カテゴリ名 
    1323      * @param integer $old_catid 旧カテゴリID 
    1324      * @param integer $new_catid 新カテゴリID 
    1325      * @param integer $id ID 
     1323     * @param  SC_Query $objQuery SC_Query インスタンス 
     1324     * @param  string   $table    テーブル名 
     1325     * @param  string   $id_name  ID名 
     1326     * @param  string   $cat_name カテゴリ名 
     1327     * @param  integer $old_catid 旧カテゴリID 
     1328     * @param  integer $new_catid 新カテゴリID 
     1329     * @param  integer  $id        ID 
    13261330     * @return void 
    13271331     */ 
    1328     function sfMoveCatRank($objQuery, $table, $id_name, $cat_name, $old_catid, $new_catid, $id) 
     1332    public function sfMoveCatRank($objQuery, $table, $id_name, $cat_name, $old_catid, $new_catid, $id) 
    13291333    { 
    13301334        if ($old_catid == $new_catid) { 
     
    13601364     * TODO SC_Query に移行するべきか? 
    13611365     * 
    1362      * @param string $table テーブル名 
    1363      * @param string $col カラム名 
    1364      * @param array $arrVal 要素の配列 
    1365      * @param array $addwhere SQL の AND 条件である WHERE 句 
    1366      * @return bool レコードが存在する場合 true 
    1367      */ 
    1368     function sfIsRecord($table, $col, $arrVal, $addwhere = '') 
     1366     * @param  string $table    テーブル名 
     1367     * @param  string $col      カラム名 
     1368     * @param  array  $arrVal  要素の配列 
     1369     * @param  array $addwhere SQL の AND 条件である WHERE 句 
     1370     * @return bool   レコードが存在する場合 true 
     1371     */ 
     1372    public function sfIsRecord($table, $col, $arrVal, $addwhere = '') 
    13691373    { 
    13701374        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    13981402     * メーカー商品数数の登録を行う. 
    13991403     * 
    1400      * @param SC_Query $objQuery SC_Query インスタンス 
     1404     * @param  SC_Query $objQuery SC_Query インスタンス 
    14011405     * @return void 
    14021406     */ 
    1403     function sfCountMaker($objQuery) 
     1407    public function sfCountMaker($objQuery) 
    14041408    { 
    14051409        $sql = ''; 
     
    14211425     * 選択中の商品のメーカーを取得する. 
    14221426     * 
    1423      * @param integer $product_id プロダクトID 
    1424      * @param integer $maker_id メーカーID 
    1425      * @return array 選択中の商品のメーカーIDの配列 
    1426      * 
    1427      */ 
    1428     function sfGetMakerId($product_id, $maker_id = 0, $closed = false) 
     1427     * @param  integer $product_id プロダクトID 
     1428     * @param  integer $maker_id  メーカーID 
     1429     * @return array   選択中の商品のメーカーIDの配列 
     1430     * 
     1431     */ 
     1432    public function sfGetMakerId($product_id, $maker_id = 0, $closed = false) 
    14291433    { 
    14301434        if ($closed) { 
     
    14401444            if (SC_Utils_Ex::sfIsInt($maker_id) && $maker_id != 0 && $this->sfIsRecord('dtb_maker','maker_id', $maker_id)) { 
    14411445                $this->g_maker_id = array($maker_id); 
    1442             } else if (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && $this->sfIsRecord('dtb_products','product_id', $product_id, $status)) { 
     1446            } elseif (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && $this->sfIsRecord('dtb_products','product_id', $product_id, $status)) { 
    14431447                $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    14441448                $maker_id = $objQuery->getCol('maker_id', 'dtb_products', 'product_id = ?', array($product_id)); 
     
    14581462     * $products_check:true商品登録済みのものだけ取得する 
    14591463     * 
    1460      * @param string $addwhere 追加する WHERE 句 
    1461      * @param bool $products_check 商品の存在するカテゴリのみ取得する場合 true 
    1462      * @return array カテゴリツリーの配列 
    1463      */ 
    1464     function sfGetMakerList($addwhere = '', $products_check = false) 
     1464     * @param  string $addwhere      追加する WHERE 句 
     1465     * @param  bool  $products_check 商品の存在するカテゴリのみ取得する場合 true 
     1466     * @return array  カテゴリツリーの配列 
     1467     */ 
     1468    public function sfGetMakerList($addwhere = '', $products_check = false) 
    14651469    { 
    14661470        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    14981502     * 店舗基本情報に基づいて税金額を返す 
    14991503     * 
    1500      * @param integer $price 計算対象の金額 
     1504     * @param  integer $price 計算対象の金額 
    15011505     * @return integer 税金額 
    15021506     */ 
    1503     function sfTax($price) 
     1507    public function sfTax($price) 
    15041508    { 
    15051509        // 店舗基本情報を取得 
     
    15131517     * SC_Utils_Ex::sfCalcIncTax とどちらか統一したほうが良い 
    15141518     * 
    1515      * @param integer $price 計算対象の金額 
     1519     * @param  integer $price 計算対象の金額 
    15161520     * @return integer 税金付与した金額 
    15171521     */ 
    1518     function sfCalcIncTax($price, $tax = null, $tax_rule = null) 
     1522    public function sfCalcIncTax($price, $tax = null, $tax_rule = null) 
    15191523    { 
    15201524        // 店舗基本情報を取得 
     
    15291533     * 店舗基本情報に基づいて加算ポイントを返す 
    15301534     * 
    1531      * @param integer $totalpoint 
    1532      * @param integer $use_point 
     1535     * @param  integer $totalpoint 
     1536     * @param  integer $use_point 
    15331537     * @return integer 加算ポイント 
    15341538     */ 
    1535     function sfGetAddPoint($totalpoint, $use_point) 
     1539    public function sfGetAddPoint($totalpoint, $use_point) 
    15361540    { 
    15371541        // 店舗基本情報を取得 
     
    15461550     * XXX プラグイン用に追加。将来消すかも。 
    15471551     * 
    1548      * @param string $sqlFilePath SQL ファイルのパス 
     1552     * @param  string $sqlFilePath SQL ファイルのパス 
    15491553     * @return void 
    15501554     */ 
    1551     function sfExecSqlByFile($sqlFilePath) 
     1555    public function sfExecSqlByFile($sqlFilePath) 
    15521556    { 
    15531557        if (file_exists($sqlFilePath)) { 
     
    15681572     * 商品規格を設定しているか 
    15691573     * 
    1570      * @param integer $product_id 商品ID 
    1571      * @return bool 商品規格が存在する場合:true, それ以外:false 
    1572      */ 
    1573     function sfHasProductClass($product_id) 
     1574     * @param  integer $product_id 商品ID 
     1575     * @return bool    商品規格が存在する場合:true, それ以外:false 
     1576     */ 
     1577    public function sfHasProductClass($product_id) 
    15741578    { 
    15751579        if (!SC_Utils_Ex::sfIsInt($product_id)) return false; 
     
    15851589     * 店舗基本情報を登録する 
    15861590     * 
    1587      * @param array $arrData 登録するデータ 
     1591     * @param  array $arrData 登録するデータ 
    15881592     * @return void 
    15891593     */ 
    1590     static function registerBasisData($arrData) 
     1594    public static function registerBasisData($arrData) 
    15911595    { 
    15921596        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    16161620     * レコード件数を計算. 
    16171621     * 
    1618      * @param string $table 
    1619      * @param string $where 
    1620      * @param array $arrval 
     1622     * @param  string $table 
     1623     * @param  string $where 
     1624     * @param  array  $arrval 
    16211625     * @return integer レコード件数 
    16221626     */ 
Note: See TracChangeset for help on using the changeset viewer.