Changeset 437
- Timestamp:
- 11/10/07 10:24:32 (1 year ago)
- Files:
-
- branches/kaste/framework/lib/AkActiveRecord.php (modified) (2 diffs)
- branches/kaste/framework/lib/AkActiveRecord/AkDbAdapter.php (modified) (5 diffs)
- branches/kaste/framework/lib/AkInstaller.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/kaste/framework/lib/AkActiveRecord.php
r436 r437 3448 3448 function transactionStart() 3449 3449 { 3450 if(!$this->isConnected()){ 3451 $this->setConnection(); 3452 } 3453 return $this->_db->StartTrans(); 3450 return $this->_db->startTransaction(); 3454 3451 } 3455 3452 3456 3453 function transactionComplete() 3457 3454 { 3458 return $this->_db-> CompleteTrans();3455 return $this->_db->stopTransaction(); 3459 3456 } 3460 3457 3461 3458 function transactionFail() 3462 3459 { 3463 $this->_db-> FailTrans();3460 $this->_db->failTransaction(); 3464 3461 return false; 3465 3462 } … … 3467 3464 function transactionHasFailed() 3468 3465 { 3469 return $this->_db-> HasFailedTrans();3466 return $this->_db->hasTransactionFailed(); 3470 3467 } 3471 3468 branches/kaste/framework/lib/AkActiveRecord/AkDbAdapter.php
r435 r437 40 40 function __destruct() 41 41 { 42 //var_dump(self::$delegated_methods);42 var_dump(self::$delegated_methods); 43 43 //var_dump(self::$delegated_properties); 44 44 } … … 84 84 } else { 85 85 $this->connection->debug = AK_DEBUG == 2; 86 //$this->connection->SetFetchMode(ADODB_FETCH_ASSOC);86 $this->connection->SetFetchMode(ADODB_FETCH_ASSOC); 87 87 defined('AK_DATABASE_CONNECTION_AVAILABLE') ? null : define('AK_DATABASE_CONNECTION_AVAILABLE', true); 88 88 } … … 247 247 248 248 /** 249 * Returns a record array with the column names as keys and column values250 * as values.251 */252 function selectOne($sql)253 {254 $result = $this->select($sql);255 return !is_null($result) ? array_shift($result) : null;256 }257 258 /**259 249 * Returns a single value from a record 260 250 */ … … 274 264 if($results = $this->select($sql)){ 275 265 foreach ($results as $result){ 276 //$values[] = array_slice(array_values($result),0,1); ??277 266 $values[] = array_shift($result); 278 267 } 279 268 } 280 269 return $values; 270 } 271 272 /** 273 * Returns a record array with the column names as keys and column values 274 * as values. 275 */ 276 function selectOne($sql) 277 { 278 $result = $this->select($sql); 279 return !is_null($result) ? array_shift($result) : null; 281 280 } 282 281 … … 317 316 } 318 317 318 /* TRANSACTIONS */ 319 320 function startTransaction() 321 { 322 return $this->connection->StartTrans(); 323 } 324 325 function stopTransaction() 326 { 327 return $this->connection->CompleteTrans(); 328 } 329 330 function failTransaction() 331 { 332 return $this->connection->FailTrans(); 333 } 334 335 function hasTransactionFailed() 336 { 337 return $this->connection->HasFailedTrans(); 338 } 339 340 /* META */ 341 function availableTables() 342 { 343 return $this->connection->MetaTables(); 344 } 345 346 function getColumnDetails($table_name) 347 { 348 349 } 319 350 } 320 351 branches/kaste/framework/lib/AkInstaller.php
r436 r437 541 541 function transactionStart() 542 542 { 543 return $this->db-> StartTrans();543 return $this->db->startTransaction(); 544 544 } 545 545 546 546 function transactionComplete() 547 547 { 548 return $this->db-> CompleteTrans();548 return $this->db->stopTransaction(); 549 549 } 550 550 551 551 function transactionFail() 552 552 { 553 return $this->db-> FailTrans();553 return $this->db->failTransaction(); 554 554 } 555 555 556 556 function transactionHasFailed() 557 557 { 558 return $this->db-> HasFailedTrans();558 return $this->db->hasTransactionFailed(); 559 559 } 560 560
