Oci.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Db
  17. * @subpackage Statement
  18. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /**
  23. * @see Zend_Db_Statement_Pdo
  24. */
  25. require_once 'Zend/Db/Statement/Pdo.php';
  26. /**
  27. * Proxy class to wrap a PDOStatement object for IBM Databases.
  28. * Matches the interface of PDOStatement. All methods simply proxy to the
  29. * matching method in PDOStatement. PDOExceptions thrown by PDOStatement
  30. * are re-thrown as Zend_Db_Statement_Exception.
  31. *
  32. * @category Zend
  33. * @package Zend_Db
  34. * @subpackage Statement
  35. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  36. * @license http://framework.zend.com/license/new-bsd New BSD License
  37. */
  38. class Zend_Db_Statement_Pdo_Oci extends Zend_Db_Statement_Pdo
  39. {
  40. /**
  41. * Returns an array containing all of the result set rows.
  42. *
  43. * Behaves like parent, but if limit()
  44. * is used, the final result removes the extra column
  45. * 'zend_db_rownum'
  46. *
  47. * @param int $style OPTIONAL Fetch mode.
  48. * @param int $col OPTIONAL Column number, if fetch mode is by column.
  49. * @return array Collection of rows, each in a format by the fetch mode.
  50. * @throws Zend_Db_Statement_Exception
  51. */
  52. public function fetchAll($style = null, $col = null)
  53. {
  54. $data = parent::fetchAll($style, $col);
  55. $results = array();
  56. $remove = $this->_adapter->foldCase('zend_db_rownum');
  57. foreach ($data as $row) {
  58. if (is_array($row) && array_key_exists($remove, $row)) {
  59. unset($row[$remove]);
  60. }
  61. $results[] = $row;
  62. }
  63. return $results;
  64. }
  65. }