FetchMode.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace Doctrine\DBAL;
  3. use PDO;
  4. /**
  5. * Contains statement fetch modes.
  6. */
  7. final class FetchMode
  8. {
  9. /**
  10. * Specifies that the fetch method shall return each row as an array indexed
  11. * by column name as returned in the corresponding result set. If the result
  12. * set contains multiple columns with the same name, the statement returns
  13. * only a single value per column name.
  14. *
  15. * @see \PDO::FETCH_ASSOC
  16. */
  17. public const ASSOCIATIVE = PDO::FETCH_ASSOC;
  18. /**
  19. * Specifies that the fetch method shall return each row as an array indexed
  20. * by column number as returned in the corresponding result set, starting at
  21. * column 0.
  22. *
  23. * @see \PDO::FETCH_NUM
  24. */
  25. public const NUMERIC = PDO::FETCH_NUM;
  26. /**
  27. * Specifies that the fetch method shall return each row as an array indexed
  28. * by both column name and number as returned in the corresponding result set,
  29. * starting at column 0.
  30. *
  31. * @see \PDO::FETCH_BOTH
  32. */
  33. public const MIXED = PDO::FETCH_BOTH;
  34. /**
  35. * Specifies that the fetch method shall return each row as an object with
  36. * property names that correspond to the column names returned in the result
  37. * set.
  38. *
  39. * @see \PDO::FETCH_OBJ
  40. */
  41. public const STANDARD_OBJECT = PDO::FETCH_OBJ;
  42. /**
  43. * Specifies that the fetch method shall return only a single requested
  44. * column from the next row in the result set.
  45. *
  46. * @see \PDO::FETCH_COLUMN
  47. */
  48. public const COLUMN = PDO::FETCH_COLUMN;
  49. /**
  50. * Specifies that the fetch method shall return a new instance of the
  51. * requested class, mapping the columns to named properties in the class.
  52. *
  53. * @see \PDO::FETCH_CLASS
  54. */
  55. public const CUSTOM_OBJECT = PDO::FETCH_CLASS;
  56. /**
  57. * This class cannot be instantiated.
  58. */
  59. private function __construct()
  60. {
  61. }
  62. }