Result.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace Doctrine\DBAL;
  3. use Doctrine\DBAL\Driver\Exception;
  4. use Traversable;
  5. /**
  6. * This interfaces contains methods allowing forward compatibility with v3.0 Result
  7. *
  8. * @see https://github.com/doctrine/dbal/blob/3.0.x/src/Result.php
  9. */
  10. interface Result extends Abstraction\Result
  11. {
  12. /**
  13. * Returns an array containing the values of the first column of the result.
  14. *
  15. * @return array<mixed,mixed>
  16. *
  17. * @throws Exception
  18. */
  19. public function fetchAllKeyValue(): array;
  20. /**
  21. * Returns an associative array with the keys mapped to the first column and the values being
  22. * an associative array representing the rest of the columns and their values.
  23. *
  24. * @return array<mixed,array<string,mixed>>
  25. *
  26. * @throws Exception
  27. */
  28. public function fetchAllAssociativeIndexed(): array;
  29. /**
  30. * Returns an iterator over the result set with the values of the first column of the result
  31. *
  32. * @return Traversable<mixed,mixed>
  33. *
  34. * @throws Exception
  35. */
  36. public function iterateKeyValue(): Traversable;
  37. /**
  38. * Returns an iterator over the result set with the keys mapped to the first column and the values being
  39. * an associative array representing the rest of the columns and their values.
  40. *
  41. * @return Traversable<mixed,array<string,mixed>>
  42. *
  43. * @throws Exception
  44. */
  45. public function iterateAssociativeIndexed(): Traversable;
  46. }