Changeset 15139 for branches/feature-module-update/data
- Timestamp:
- 2007/07/27 11:21:45 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update/data/class/db/SC_DB_MasterData.php
r15135 r15139 94 94 $sqlVal = array($columns[0] => $key, 95 95 $columns[1] => $val, 96 $columns[2] => $i);96 $columns[2] => (string) $i); 97 97 $this->objQuery->insert($name, $sqlVal); 98 98 $i++; … … 130 130 // マスタデータを削除 131 131 $this->deleteMasterData($name, false); 132 132 133 // マスタデータを追加 133 134 $this->registMasterData($name, $columns, $masterData, false); 135 134 136 if ($autoCommit) { 135 137 $this->objQuery->commit(); 136 138 } 137 138 // キャッシュを消去 139 $this->clearCache($name); 140 // 新規にデータを取得してキャッシュ生成 141 $newData = $this->getMasterData($name, $columns); 142 return count($newData); 139 return count($masterData); 143 140 } 144 141 … … 155 152 function deleteMasterData($name, $autoCommit = true) { 156 153 $this->objQuery = new SC_Query(); 157 return $this->objQuery->delete($name); 154 if ($autoCommit) { 155 $this->objQuery->begin(); 156 } 157 158 // DB の内容とキャッシュをクリア 159 $result = $this->objQuery->delete($name); 160 $this->clearCache($name); 161 162 if ($autoCommit) { 163 $this->objQuery->commit(); 164 } 165 return $result; 158 166 } 159 167 … … 165 173 */ 166 174 function clearCache($name) { 167 unlink(MASTER_DATA_DIR . $name . ".php"); 175 $masterDataFile = MASTER_DATA_DIR . $name . ".php"; 176 if (is_file($masterDataFile)) { 177 unlink($masterDataFile); 178 } 168 179 } 169 180
Note: See TracChangeset
for help on using the changeset viewer.