FetchMode.php 2.0 KB

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