/libraries/joomla/database/query/limitable.php

https://gitlab.com/vitaliylukin91/text · PHP · 54 lines · 7 code · 3 blank · 44 comment · 0 complexity · 8c449d613d4193d5788ff9295ea2e5a5 MD5 · raw file

  1. <?php
  2. /**
  3. * @package Joomla.Platform
  4. * @subpackage Database
  5. *
  6. * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE
  8. */
  9. defined('JPATH_PLATFORM') or die;
  10. /**
  11. * Joomla Database Query Limitable Interface.
  12. * Adds bind/unbind methods as well as a getBounded() method
  13. * to retrieve the stored bounded variables on demand prior to
  14. * query execution.
  15. *
  16. * @since 12.1
  17. */
  18. interface JDatabaseQueryLimitable
  19. {
  20. /**
  21. * Method to modify a query already in string format with the needed
  22. * additions to make the query limited to a particular number of
  23. * results, or start at a particular offset. This method is used
  24. * automatically by the __toString() method if it detects that the
  25. * query implements the JDatabaseQueryLimitable interface.
  26. *
  27. * @param string $query The query in string format
  28. * @param integer $limit The limit for the result set
  29. * @param integer $offset The offset for the result set
  30. *
  31. * @return string
  32. *
  33. * @since 12.1
  34. */
  35. public function processLimit($query, $limit, $offset = 0);
  36. /**
  37. * Sets the offset and limit for the result set, if the database driver supports it.
  38. *
  39. * Usage:
  40. * $query->setLimit(100, 0); (retrieve 100 rows, starting at first record)
  41. * $query->setLimit(50, 50); (retrieve 50 rows, starting at 50th record)
  42. *
  43. * @param integer $limit The limit for the result set
  44. * @param integer $offset The offset for the result set
  45. *
  46. * @return JDatabaseQuery Returns this object to allow chaining.
  47. *
  48. * @since 12.1
  49. */
  50. public function setLimit($limit = 0, $offset = 0);
  51. }