QueryInterface.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\DB;
  7. /**
  8. * Class QueryInterface
  9. */
  10. interface QueryInterface
  11. {
  12. /**
  13. * Retrieve source Criteria object
  14. *
  15. * @return \Magento\Framework\Api\CriteriaInterface
  16. */
  17. public function getCriteria();
  18. /**
  19. * Retrieve all ids for query
  20. *
  21. * @return array
  22. */
  23. public function getAllIds();
  24. /**
  25. * Add variable to bind list
  26. *
  27. * @param string $name
  28. * @param mixed $value
  29. * @return void
  30. */
  31. public function addBindParam($name, $value);
  32. /**
  33. * Get collection size
  34. *
  35. * @return int
  36. */
  37. public function getSize();
  38. /**
  39. * Get sql select string or object
  40. *
  41. * @param bool $stringMode
  42. * @return string || Select
  43. */
  44. public function getSelectSql($stringMode = false);
  45. /**
  46. * Reset Statement object
  47. *
  48. * @return void
  49. */
  50. public function reset();
  51. /**
  52. * Fetch all statement
  53. *
  54. * @return array
  55. */
  56. public function fetchAll();
  57. /**
  58. * Fetch statement
  59. *
  60. * @return mixed
  61. */
  62. public function fetchItem();
  63. /**
  64. * Get Identity Field Name
  65. *
  66. * @return string
  67. */
  68. public function getIdFieldName();
  69. /**
  70. * Retrieve connection object
  71. *
  72. * @return \Magento\Framework\DB\Adapter\AdapterInterface
  73. */
  74. public function getConnection();
  75. /**
  76. * Get resource instance
  77. *
  78. * @return \Magento\Framework\Model\ResourceModel\Db\AbstractDb
  79. */
  80. public function getResource();
  81. /**
  82. * Add Select Part to skip from count query
  83. *
  84. * @param string $name
  85. * @param bool $toSkip
  86. * @return void
  87. */
  88. public function addCountSqlSkipPart($name, $toSkip = true);
  89. }