- Timestamp:
- 2013/08/26 15:52:37 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13_0/data/class/helper/SC_Helper_DB.php
r22960 r23126 32 32 { 33 33 /** ルートカテゴリ取得フラグ */ 34 var$g_root_on;34 public $g_root_on; 35 35 36 36 /** ルートカテゴリID */ 37 var$g_root_id;37 public $g_root_id; 38 38 39 39 /** 選択中カテゴリ取得フラグ */ 40 var$g_category_on;40 public $g_category_on; 41 41 42 42 /** 選択中カテゴリID */ 43 var$g_category_id;43 public $g_category_id; 44 44 45 45 /** … … 50 50 * カラムの生成も行う場合は, $col_type も必須となる. 51 51 * 52 * @param string $$tableNameテーブル名53 * @param string $column_name カラム名54 * @param string $col_typeカラムのデータ型55 * @param string $dsnデータソース名56 * @param bool $addカラムの作成も行う場合 true57 * @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, 58 58 * テーブルが存在しない場合 false, 59 59 * 引数 $add == false でカラムが存在しない場合 false 60 60 */ 61 function sfColumnExists($tableName, $colName, $colType = '', $dsn = '', $add = false)61 public function sfColumnExists($tableName, $colName, $colType = '', $dsn = '', $add = false) 62 62 { 63 63 $dbFactory = SC_DB_DBFactory_Ex::getInstance(); … … 87 87 } 88 88 89 function sfColumnAdd($tableName, $colName, $colType) { 89 public function sfColumnAdd($tableName, $colName, $colType) 90 { 90 91 $objQuery =& SC_Query_Ex::getSingletonInstance($dsn); 91 92 … … 96 97 * データの存在チェックを行う. 97 98 * 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, 102 103 * $add == false で, データが存在しない場合 false 103 104 */ 104 function sfDataExists($tableName, $where, $arrWhereVal)105 public function sfDataExists($tableName, $where, $arrWhereVal) 105 106 { 106 107 $dbFactory = SC_DB_DBFactory_Ex::getInstance(); … … 124 125 * 2回目以降はキャッシュされた結果を使用する. 125 126 * 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) 130 131 { 131 132 static $arrData = null; … … 143 144 * 基本情報のキャッシュデータを取得する 144 145 * 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) 149 150 { 150 151 // テーブル名 … … 179 180 * @return bool キャッシュデータファイル生成結果 180 181 */ 181 function sfCreateBasisDataCache()182 public function sfCreateBasisDataCache() 182 183 { 183 184 // テーブル名 … … 199 200 // ファイルを閉じる 200 201 fclose($handle); 201 if ( 202 if ($res === false) { 202 203 // ファイル生成失敗 203 204 return false; … … 213 214 * @deprecated 214 215 */ 215 function sfGetBasisCount()216 public function sfGetBasisCount() 216 217 { 217 218 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 225 226 * @return boolean 有無 226 227 */ 227 function sfGetBasisExists()228 public function sfGetBasisExists() 228 229 { 229 230 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 233 234 234 235 /* 選択中のアイテムのルートカテゴリIDを取得する */ 235 function sfGetRootId()236 public function sfGetRootId() 236 237 { 237 238 if (!$this->g_root_on) { … … 264 265 * 受注番号、最終ポイント、加算ポイント、利用ポイントから「オーダー前ポイント」を取得する 265 266 * 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) 273 274 { 274 275 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 300 301 * カテゴリツリーの取得を行う. 301 302 * 302 * @param integer $parent_category_id 親カテゴリID303 * @param bool $count_check登録商品数のチェックを行う場合 true304 * @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) 307 308 { 308 309 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 351 352 * @see sfGetCatTree() 352 353 */ 353 function findTree(&$arrTree, $parent, &$result)354 public function findTree(&$arrTree, $parent, &$result) 354 355 { 355 356 if ($result[count($result) - 1]['parent_category_id'] === 0) { … … 372 373 * カテゴリツリーの取得を複数カテゴリで行う. 373 374 * 374 * @param integer $product_id商品ID375 * @param bool$count_check 登録商品数のチェックを行う場合 true376 * @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) 379 380 { 380 381 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 422 423 * 親カテゴリを連結した文字列を取得する. 423 424 * 424 * @param integer $category_id カテゴリID425 * @return string 親カテゴリを連結した文字列426 */ 427 function sfGetCatCombName($category_id)425 * @param integer $category_id カテゴリID 426 * @return string 親カテゴリを連結した文字列 427 */ 428 public function sfGetCatCombName($category_id) 428 429 { 429 430 // 商品が属するカテゴリIDを縦に取得 … … 448 449 * 指定したカテゴリIDの大カテゴリを取得する. 449 450 * 450 * @param integer $category_id カテゴリID451 * @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) 454 455 { 455 456 // 商品が属するカテゴリIDを縦に取得 … … 472 473 * $products_check:true商品登録済みのものだけ取得する 473 474 * 474 * @param string $addwhere追加する WHERE 句475 * @param bool$products_check 商品の存在するカテゴリのみ取得する場合 true476 * @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) 480 481 { 481 482 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 515 516 * 親カテゴリの Value=0 を対象とする 516 517 * 517 * @param bool$parent_zero 親カテゴリの Value=0 の場合 true518 * @param bool $parent_zero 親カテゴリの Value=0 の場合 true 518 519 * @return array カテゴリツリーの配列 519 520 */ 520 function sfGetLevelCatList($parent_zero = true)521 public function sfGetLevelCatList($parent_zero = true) 521 522 { 522 523 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 563 564 * 選択中の商品のカテゴリを取得する. 564 565 * 565 * @param integer $product_idプロダクトID566 * @param integer $category_id カテゴリID567 * @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) 571 572 { 572 573 if ($closed) { … … 579 580 if (SC_Utils_Ex::sfIsInt($category_id) && $category_id != 0 && SC_Helper_DB_Ex::sfIsRecord('dtb_category','category_id', $category_id)) { 580 581 $category_id = array($category_id); 581 } else 582 } elseif (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && SC_Helper_DB_Ex::sfIsRecord('dtb_products','product_id', $product_id, $status)) { 582 583 $objQuery =& SC_Query_Ex::getSingletonInstance(); 583 584 $category_id = $objQuery->getCol('category_id', 'dtb_product_categories', 'product_id = ?', array($product_id)); … … 593 594 * 商品をカテゴリの先頭に追加する. 594 595 * 595 * @param integer $category_id カテゴリID596 * @param integer $product_idプロダクトID596 * @param integer $category_id カテゴリID 597 * @param integer $product_id プロダクトID 597 598 * @return void 598 599 */ 599 function addProductBeforCategories($category_id, $product_id)600 public function addProductBeforCategories($category_id, $product_id) 600 601 { 601 602 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 615 616 * 商品をカテゴリの末尾に追加する. 616 617 * 617 * @param integer $category_id カテゴリID618 * @param integer $product_idプロダクトID618 * @param integer $category_id カテゴリID 619 * @param integer $product_id プロダクトID 619 620 * @return void 620 621 */ 621 function addProductAfterCategories($category_id, $product_id)622 public function addProductAfterCategories($category_id, $product_id) 622 623 { 623 624 $sqlval = array('category_id' => $category_id, … … 648 649 * 商品をカテゴリから削除する. 649 650 * 650 * @param integer $category_id カテゴリID651 * @param integer $product_idプロダクトID651 * @param integer $category_id カテゴリID 652 * @param integer $product_id プロダクトID 652 653 * @return void 653 654 */ 654 function removeProductByCategories($category_id, $product_id)655 public function removeProductByCategories($category_id, $product_id) 655 656 { 656 657 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 662 663 * 商品カテゴリを更新する. 663 664 * 664 * @param array$arrCategory_id 登録するカテゴリIDの配列665 * @param integer $product_idプロダクトID665 * @param array $arrCategory_id 登録するカテゴリIDの配列 666 * @param integer $product_id プロダクトID 666 667 * @return void 667 668 */ 668 function updateProductCategories($arrCategory_id, $product_id)669 public function updateProductCategories($arrCategory_id, $product_id) 669 670 { 670 671 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 695 696 * 696 697 * 697 * @param SC_Query $objQuerySC_Query インスタンス698 * @param boolean$is_force_all_count 全カテゴリの集計を強制する場合 true698 * @param SC_Query $objQuery SC_Query インスタンス 699 * @param boolean $is_force_all_count 全カテゴリの集計を強制する場合 true 699 700 * @return void 700 701 */ 701 function sfCountCategory($objQuery = NULL, $is_force_all_count = false)702 public function sfCountCategory($objQuery = NULL, $is_force_all_count = false) 702 703 { 703 704 $objProduct = new SC_Product_Ex(); … … 783 784 $objQuery->commit(); 784 785 } 786 785 787 return; 786 788 } … … 793 795 $sqlval = array(); 794 796 $sqlval['create_date'] = 'CURRENT_TIMESTAMP'; 795 $sqlval['product_count'] = (string) $arrNew[$cid];797 $sqlval['product_count'] = (string) $arrNew[$cid]; 796 798 if ($sqlval['product_count'] =='') { 797 $sqlval['product_count'] = (string) '0';799 $sqlval['product_count'] = (string) '0'; 798 800 } 799 801 if (isset($arrOld[$cid])) { … … 854 856 $sqlval['product_count'] = $count; 855 857 if ($sqlval['product_count'] =='') { 856 $sqlval['product_count'] = (string) '0';858 $sqlval['product_count'] = (string) '0'; 857 859 } 858 860 $ret = $objQuery->update('dtb_category_total_count', $sqlval, 'category_id = ?', array($cid)); … … 871 873 * 子IDの配列を返す. 872 874 * 873 * @param string $tableテーブル名874 * @param string $pid_name 親ID名875 * @param string $id_nameID名876 * @param integer $id ID875 * @param string $table テーブル名 876 * @param string $pid_name 親ID名 877 * @param string $id_name ID名 878 * @param integer $id ID 877 879 * @param array 子ID の配列 878 880 */ 879 function sfGetChildsID($table, $pid_name, $id_name, $id)881 public function sfGetChildsID($table, $pid_name, $id_name, $id) 880 882 { 881 883 $arrRet = $this->sfGetChildrenArray($table, $pid_name, $id_name, $id); … … 887 889 * 階層構造のテーブルから子ID配列を取得する. 888 890 * 889 * @param string $tableテーブル名890 * @param string$pid_name 親ID名891 * @param string $id_nameID名892 * @param integer $idID番号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) 896 898 { 897 899 $arrChildren = array(); … … 909 911 * 親ID直下の子IDを全て取得する. 910 912 * 911 * @param array $arrData親カテゴリの配列912 * @param string $pid_name 親ID名913 * @param string $id_nameID名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) 918 920 { 919 921 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 929 931 * 所属する全ての階層の親IDを配列で返す. 930 932 * 931 * @param SC_Query $objQuery SC_Query インスタンス932 * @param string $tableテーブル名933 * @param string$pid_name 親ID名934 * @param string $id_nameID名935 * @param integer $idID936 * @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) 939 941 { 940 942 $arrRet = SC_Helper_DB_Ex::sfGetParentsArray($table, $pid_name, $id_name, $id); … … 946 948 * 階層構造のテーブルから親ID配列を取得する. 947 949 * 948 * @param string $tableテーブル名949 * @param string$pid_name 親ID名950 * @param string $id_nameID名951 * @param integer $idID952 * @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) 955 957 { 956 958 $arrParents = array(); … … 968 970 969 971 /* 子ID所属する親IDを取得する */ 970 function sfGetParentsArraySub($table, $pid_name, $id_name, $child)972 public function sfGetParentsArraySub($table, $pid_name, $id_name, $child) 971 973 { 972 974 if (SC_Utils_Ex::isBlank($child)) { … … 985 987 * カテゴリから商品を検索する場合のWHERE文と値を返す. 986 988 * 987 * @param integer $category_id カテゴリID988 * @return array 商品を検索する場合の配列989 */ 990 function sfGetCatWhere($category_id)989 * @param integer $category_id カテゴリID 990 * @return array 商品を検索する場合の配列 991 */ 992 public function sfGetCatWhere($category_id) 991 993 { 992 994 // 子カテゴリIDの取得 … … 1001 1003 * SELECTボックス用リストを作成する. 1002 1004 * 1003 * @param string $tableテーブル名1004 * @param string $keynameプライマリーキーのカラム名1005 * @param string $valnameデータ内容のカラム名1006 * @param string $whereWHERE句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()) 1011 1013 { 1012 1014 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 1029 1031 * ランキングを上げる. 1030 1032 * 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 句 1035 1037 * @return void 1036 1038 */ 1037 function sfRankUp($table, $colname, $id, $andwhere = '')1039 public function sfRankUp($table, $colname, $id, $andwhere = '') 1038 1040 { 1039 1041 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 1081 1083 * ランキングを下げる. 1082 1084 * 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 句 1087 1089 * @return void 1088 1090 */ 1089 function sfRankDown($table, $colname, $id, $andwhere = '')1091 public function sfRankDown($table, $colname, $id, $andwhere = '') 1090 1092 { 1091 1093 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 1132 1134 * 指定順位へ移動する. 1133 1135 * 1134 * @param string $tableNameテーブル名1135 * @param string$keyIdColumn キーを保持するカラム名1136 * @param string|integer $keyIdキーの値1137 * @param integer $pos指定順位1138 * @param string $whereSQL の 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 句 1139 1141 * @return void 1140 1142 */ 1141 function sfMoveRank($tableName, $keyIdColumn, $keyId, $pos, $where = '')1143 public function sfMoveRank($tableName, $keyIdColumn, $keyId, $pos, $where = '') 1142 1144 { 1143 1145 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 1182 1184 * 指定位置が1番下へ移動なら、newRankは1 1183 1185 * 1184 * @param int $position 指定された位置1185 * @param int $maxRank現在のランク最大値1186 * @param int $position 指定された位置 1187 * @param int $maxRank 現在のランク最大値 1186 1188 * @return int $newRank DBに登録するRANK値 1187 1189 */ 1188 function getNewRank($position, $maxRank) { 1190 public function getNewRank($position, $maxRank) 1191 { 1189 1192 if ($position > $maxRank) { 1190 1193 $newRank = 1; 1191 } else 1194 } elseif ($position < 1) { 1192 1195 $newRank = $maxRank; 1193 1196 } else { … … 1201 1204 * 指定した順位の商品から移動させる商品までのrankを1つずらす 1202 1205 * 1203 * @param int$newRank1204 * @param int$oldRank1205 * @param object$objQuery1206 * @param string$where1206 * @param int $newRank 1207 * @param int $oldRank 1208 * @param object $objQuery 1209 * @param string $where 1207 1210 * @return boolean 1208 1211 */ 1209 function moveOtherItemRank($newRank, $oldRank, &$objQuery, $tableName, $addWhere) { 1212 public function moveOtherItemRank($newRank, $oldRank, &$objQuery, $tableName, $addWhere) 1213 { 1210 1214 $sqlval = array(); 1211 1215 $arrRawSql = array(); … … 1218 1222 $arrRawSql['rank'] = 'rank - 1'; 1219 1223 $arrWhereVal = array($oldRank + 1, $newRank); 1220 } else 1224 } elseif ($newRank < $oldRank) { 1221 1225 //位置を下げる場合、他の商品の位置を1つ上げる(ランクを1上げる) 1222 1226 $arrRawSql['rank'] = 'rank + 1'; … … 1235 1239 * レコードごと削除する場合は、$deleteをtrueにする 1236 1240 * 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, 1242 1246 * レコードごと削除しない場合 false 1243 1247 * @return void 1244 1248 */ 1245 function sfDeleteRankRecord($table, $colname, $id, $andwhere = '',1249 public function sfDeleteRankRecord($table, $colname, $id, $andwhere = '', 1246 1250 $delete = false) { 1247 1251 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 1285 1289 * 親IDの配列を元に特定のカラムを取得する. 1286 1290 * 1287 * @param SC_Query $objQuery SC_Query インスタンス1288 * @param string $tableテーブル名1289 * @param string $id_nameID名1290 * @param string$col_name カラム名1291 * @param array $arrIdIDの配列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) 1295 1299 { 1296 1300 $col = $col_name; … … 1317 1321 * ※この関数って、どこからも呼ばれていないのでは?? 1318 1322 * 1319 * @param SC_Query $objQuerySC_Query インスタンス1320 * @param string $tableテーブル名1321 * @param string $id_nameID名1322 * @param string $cat_nameカテゴリ名1323 * @param integer$old_catid 旧カテゴリID1324 * @param integer$new_catid 新カテゴリID1325 * @param integer $idID1323 * @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 1326 1330 * @return void 1327 1331 */ 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) 1329 1333 { 1330 1334 if ($old_catid == $new_catid) { … … 1360 1364 * TODO SC_Query に移行するべきか? 1361 1365 * 1362 * @param string $tableテーブル名1363 * @param string $colカラム名1364 * @param array $arrVal要素の配列1365 * @param array$addwhere SQL の AND 条件である WHERE 句1366 * @return bool レコードが存在する場合 true1367 */ 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 = '') 1369 1373 { 1370 1374 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 1398 1402 * メーカー商品数数の登録を行う. 1399 1403 * 1400 * @param SC_Query $objQuery SC_Query インスタンス1404 * @param SC_Query $objQuery SC_Query インスタンス 1401 1405 * @return void 1402 1406 */ 1403 function sfCountMaker($objQuery)1407 public function sfCountMaker($objQuery) 1404 1408 { 1405 1409 $sql = ''; … … 1421 1425 * 選択中の商品のメーカーを取得する. 1422 1426 * 1423 * @param integer $product_id プロダクトID1424 * @param integer $maker_idメーカーID1425 * @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) 1429 1433 { 1430 1434 if ($closed) { … … 1440 1444 if (SC_Utils_Ex::sfIsInt($maker_id) && $maker_id != 0 && $this->sfIsRecord('dtb_maker','maker_id', $maker_id)) { 1441 1445 $this->g_maker_id = array($maker_id); 1442 } else 1446 } elseif (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && $this->sfIsRecord('dtb_products','product_id', $product_id, $status)) { 1443 1447 $objQuery =& SC_Query_Ex::getSingletonInstance(); 1444 1448 $maker_id = $objQuery->getCol('maker_id', 'dtb_products', 'product_id = ?', array($product_id)); … … 1458 1462 * $products_check:true商品登録済みのものだけ取得する 1459 1463 * 1460 * @param string $addwhere追加する WHERE 句1461 * @param bool$products_check 商品の存在するカテゴリのみ取得する場合 true1462 * @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) 1465 1469 { 1466 1470 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 1498 1502 * 店舗基本情報に基づいて税金額を返す 1499 1503 * 1500 * @param integer $price 計算対象の金額1504 * @param integer $price 計算対象の金額 1501 1505 * @return integer 税金額 1502 1506 */ 1503 function sfTax($price)1507 public function sfTax($price) 1504 1508 { 1505 1509 // 店舗基本情報を取得 … … 1513 1517 * SC_Utils_Ex::sfCalcIncTax とどちらか統一したほうが良い 1514 1518 * 1515 * @param integer $price 計算対象の金額1519 * @param integer $price 計算対象の金額 1516 1520 * @return integer 税金付与した金額 1517 1521 */ 1518 function sfCalcIncTax($price, $tax = null, $tax_rule = null)1522 public function sfCalcIncTax($price, $tax = null, $tax_rule = null) 1519 1523 { 1520 1524 // 店舗基本情報を取得 … … 1529 1533 * 店舗基本情報に基づいて加算ポイントを返す 1530 1534 * 1531 * @param integer $totalpoint1532 * @param integer $use_point1535 * @param integer $totalpoint 1536 * @param integer $use_point 1533 1537 * @return integer 加算ポイント 1534 1538 */ 1535 function sfGetAddPoint($totalpoint, $use_point)1539 public function sfGetAddPoint($totalpoint, $use_point) 1536 1540 { 1537 1541 // 店舗基本情報を取得 … … 1546 1550 * XXX プラグイン用に追加。将来消すかも。 1547 1551 * 1548 * @param string $sqlFilePath SQL ファイルのパス1552 * @param string $sqlFilePath SQL ファイルのパス 1549 1553 * @return void 1550 1554 */ 1551 function sfExecSqlByFile($sqlFilePath)1555 public function sfExecSqlByFile($sqlFilePath) 1552 1556 { 1553 1557 if (file_exists($sqlFilePath)) { … … 1568 1572 * 商品規格を設定しているか 1569 1573 * 1570 * @param integer $product_id 商品ID1571 * @return bool 商品規格が存在する場合:true, それ以外:false1572 */ 1573 function sfHasProductClass($product_id)1574 * @param integer $product_id 商品ID 1575 * @return bool 商品規格が存在する場合:true, それ以外:false 1576 */ 1577 public function sfHasProductClass($product_id) 1574 1578 { 1575 1579 if (!SC_Utils_Ex::sfIsInt($product_id)) return false; … … 1585 1589 * 店舗基本情報を登録する 1586 1590 * 1587 * @param array $arrData 登録するデータ1591 * @param array $arrData 登録するデータ 1588 1592 * @return void 1589 1593 */ 1590 static function registerBasisData($arrData)1594 public static function registerBasisData($arrData) 1591 1595 { 1592 1596 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 1616 1620 * レコード件数を計算. 1617 1621 * 1618 * @param string$table1619 * @param string$where1620 * @param array$arrval1622 * @param string $table 1623 * @param string $where 1624 * @param array $arrval 1621 1625 * @return integer レコード件数 1622 1626 */
Note: See TracChangeset
for help on using the changeset viewer.