zendrowsetAdapter.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * This Adapter translates the specific Database type links to the data and pulls the data into very
  4. * specific local variables to later be retrieved by the gateway and returned to the client.
  5. *
  6. * pdoAdapter is a contribution of Andrea Giammarchi
  7. *
  8. * Now using fast serialization
  9. *
  10. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  11. * @copyright (c) 2003 amfphp.org
  12. * @package flashservices
  13. * @subpackage adapters
  14. * @version $Id: sqliteAdapter.php,v 1.1 2005/07/05 07:56:29 pmineault Exp $
  15. */
  16. require_once(AMFPHP_BASE . "shared/adapters/RecordSetAdapter.php");
  17. class zendrowsetAdapter extends RecordSetAdapter
  18. {
  19. function zendrowsetAdapter($d) {
  20. parent::RecordSetAdapter($d);
  21. if($d->count() > 0)
  22. {
  23. $d->rewind();
  24. $firstRow = $d->current()->toArray();
  25. $this->columns = array_keys($firstRow);
  26. //Note: foreach resets array iterator pointer
  27. foreach($d as $row)
  28. {
  29. $this->rows[] = array_values($row->toArray());
  30. }
  31. }
  32. }
  33. }
  34. ?
  35. >