Changeset 23022 for branches/version-2_13-dev/data/module/MDB2/Extended.php
- Timestamp:
- 2013/08/02 13:22:57 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13-dev/data/module/MDB2/Extended.php
r20764 r23022 43 43 // +----------------------------------------------------------------------+ 44 44 // 45 // $Id: Extended.php ,v 1.60 2007/11/28 19:49:34 quipo Exp$45 // $Id: Extended.php 327310 2012-08-27 15:16:18Z danielc $ 46 46 47 47 /** … … 94 94 { 95 95 $query = $this->buildManipSQL($table, $table_fields, $mode, $where); 96 if ( PEAR::isError($query)) {96 if (MDB2::isError($query)) { 97 97 return $query; 98 98 } 99 $db = &$this->getDBInstance();100 if ( PEAR::isError($db)) {99 $db = $this->getDBInstance(); 100 if (MDB2::isError($db)) { 101 101 return $db; 102 102 } … … 135 135 * @access public 136 136 */ 137 function &autoExecute($table, $fields_values, $mode = MDB2_AUTOQUERY_INSERT,137 function autoExecute($table, $fields_values, $mode = MDB2_AUTOQUERY_INSERT, 138 138 $where = false, $types = null, $result_class = true, $result_types = MDB2_PREPARE_MANIP) 139 139 { … … 154 154 $query = $this->buildManipSQL($table, $keys, $mode, $where); 155 155 156 $db = &$this->getDBInstance();157 if ( PEAR::isError($db)) {156 $db = $this->getDBInstance(); 157 if (MDB2::isError($db)) { 158 158 return $db; 159 159 } 160 160 if ($mode == MDB2_AUTOQUERY_SELECT) { 161 $result = &$db->query($query, $result_types, $result_class);161 $result = $db->query($query, $result_types, $result_class); 162 162 } else { 163 163 $result = $db->exec($query); … … 165 165 } else { 166 166 $stmt = $this->autoPrepare($table, $keys, $mode, $where, $types, $result_types); 167 if ( PEAR::isError($stmt)) {167 if (MDB2::isError($stmt)) { 168 168 return $stmt; 169 169 } 170 $result = &$stmt->execute($params, $result_class);170 $result = $stmt->execute($params, $result_class); 171 171 $stmt->free(); 172 172 } … … 200 200 function buildManipSQL($table, $table_fields, $mode, $where = false) 201 201 { 202 $db = &$this->getDBInstance();203 if ( PEAR::isError($db)) {202 $db = $this->getDBInstance(); 203 if (MDB2::isError($db)) { 204 204 return $db; 205 205 } … … 215 215 } 216 216 217 if ( $where !== false && !is_null($where)) {217 if ((false !== $where) && (null !== $where)) { 218 218 if (is_array($where)) { 219 219 $where = implode(' AND ', $where); … … 271 271 * @access public 272 272 */ 273 function &limitQuery($query, $types, $limit, $offset = 0, $result_class = true,273 function limitQuery($query, $types, $limit, $offset = 0, $result_class = true, 274 274 $result_wrap_class = false) 275 275 { 276 $db = &$this->getDBInstance();277 if ( PEAR::isError($db)) {276 $db = $this->getDBInstance(); 277 if (MDB2::isError($db)) { 278 278 return $db; 279 279 } 280 280 281 281 $result = $db->setLimit($limit, $offset); 282 if ( PEAR::isError($result)) {282 if (MDB2::isError($result)) { 283 283 return $result; 284 284 } 285 $result =& $db->query($query, $types, $result_class, $result_wrap_class); 286 return $result; 285 return $db->query($query, $types, $result_class, $result_wrap_class); 287 286 } 288 287 … … 303 302 function execParam($query, $params = array(), $param_types = null) 304 303 { 305 $db = &$this->getDBInstance();306 if ( PEAR::isError($db)) {304 $db = $this->getDBInstance(); 305 if (MDB2::isError($db)) { 307 306 return $db; 308 307 } … … 314 313 315 314 $stmt = $db->prepare($query, $param_types, MDB2_PREPARE_MANIP); 316 if ( PEAR::isError($stmt)) {315 if (MDB2::isError($stmt)) { 317 316 return $stmt; 318 317 } 319 318 320 319 $result = $stmt->execute($params); 321 if ( PEAR::isError($result)) {320 if (MDB2::isError($result)) { 322 321 return $result; 323 322 } … … 347 346 $param_types = null, $colnum = 0) 348 347 { 349 $db = &$this->getDBInstance();350 if ( PEAR::isError($db)) {348 $db = $this->getDBInstance(); 349 if (MDB2::isError($db)) { 351 350 return $db; 352 351 } … … 359 358 360 359 $stmt = $db->prepare($query, $param_types, $type); 361 if ( PEAR::isError($stmt)) {360 if (MDB2::isError($stmt)) { 362 361 return $stmt; 363 362 } … … 394 393 $param_types = null, $fetchmode = MDB2_FETCHMODE_DEFAULT) 395 394 { 396 $db = &$this->getDBInstance();397 if ( PEAR::isError($db)) {395 $db = $this->getDBInstance(); 396 if (MDB2::isError($db)) { 398 397 return $db; 399 398 } … … 405 404 406 405 $stmt = $db->prepare($query, $param_types, $types); 407 if ( PEAR::isError($stmt)) {406 if (MDB2::isError($stmt)) { 408 407 return $stmt; 409 408 } … … 440 439 $param_types = null, $colnum = 0) 441 440 { 442 $db = &$this->getDBInstance();443 if ( PEAR::isError($db)) {441 $db = $this->getDBInstance(); 442 if (MDB2::isError($db)) { 444 443 return $db; 445 444 } … … 452 451 453 452 $stmt = $db->prepare($query, $param_types, $type); 454 if ( PEAR::isError($stmt)) {453 if (MDB2::isError($stmt)) { 455 454 return $stmt; 456 455 } … … 496 495 $rekey = false, $force_array = false, $group = false) 497 496 { 498 $db = &$this->getDBInstance();499 if ( PEAR::isError($db)) {497 $db = $this->getDBInstance(); 498 if (MDB2::isError($db)) { 500 499 return $db; 501 500 } … … 507 506 508 507 $stmt = $db->prepare($query, $param_types, $types); 509 if ( PEAR::isError($stmt)) {508 if (MDB2::isError($stmt)) { 510 509 return $stmt; 511 510 } … … 601 600 $fetchmode = MDB2_FETCHMODE_DEFAULT, $force_array = false, $group = false) 602 601 { 603 $db = &$this->getDBInstance();604 if ( PEAR::isError($db)) {602 $db = $this->getDBInstance(); 603 if (MDB2::isError($db)) { 605 604 return $db; 606 605 } … … 612 611 613 612 $stmt = $db->prepare($query, $param_types, $types); 614 if ( PEAR::isError($stmt)) {613 if (MDB2::isError($stmt)) { 615 614 return $stmt; 616 615 } … … 645 644 * @see prepare(), execute() 646 645 */ 647 function executeMultiple(&$stmt, $params = null) 648 { 646 function executeMultiple($stmt, $params = null) 647 { 648 if (MDB2::isError($stmt)) { 649 return $stmt; 650 } 649 651 for ($i = 0, $j = count($params); $i < $j; $i++) { 650 652 $result = $stmt->execute($params[$i]); 651 if ( PEAR::isError($result)) {653 if (MDB2::isError($result)) { 652 654 return $result; 653 655 } … … 673 675 function getBeforeID($table, $field = null, $ondemand = true, $quote = true) 674 676 { 675 $db = &$this->getDBInstance();676 if ( PEAR::isError($db)) {677 $db = $this->getDBInstance(); 678 if (MDB2::isError($db)) { 677 679 return $db; 678 680 } … … 681 683 $seq = $table.(empty($field) ? '' : '_'.$field); 682 684 $id = $db->nextID($seq, $ondemand); 683 if (!$quote || PEAR::isError($id)) {685 if (!$quote || MDB2::isError($id)) { 684 686 return $id; 685 687 } … … 706 708 function getAfterID($id, $table, $field = null) 707 709 { 708 $db = &$this->getDBInstance();709 if ( PEAR::isError($db)) {710 $db = $this->getDBInstance(); 711 if (MDB2::isError($db)) { 710 712 return $db; 711 713 }
Note: See TracChangeset
for help on using the changeset viewer.
