/libraries/joomla/database/query/preparable.php

https://gitlab.com/vitaliylukin91/text · PHP · 51 lines · 7 code · 3 blank · 41 comment · 0 complexity · d7eed30c92bbdd8ab6d2487bb3030578 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 Preparable 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 JDatabaseQueryPreparable
  19. {
  20. /**
  21. * Method to add a variable to an internal array that will be bound to a prepared SQL statement before query execution. Also
  22. * removes a variable that has been bounded from the internal bounded array when the passed in value is null.
  23. *
  24. * @param string|integer $key The key that will be used in your SQL query to reference the value. Usually of
  25. * the form ':key', but can also be an integer.
  26. * @param mixed &$value The value that will be bound. The value is passed by reference to support output
  27. * parameters such as those possible with stored procedures.
  28. * @param integer $dataType Constant corresponding to a SQL datatype.
  29. * @param integer $length The length of the variable. Usually required for OUTPUT parameters.
  30. * @param array $driverOptions Optional driver options to be used.
  31. *
  32. * @return JDatabaseQuery
  33. *
  34. * @since 12.1
  35. */
  36. public function bind($key = null, &$value = null, $dataType = PDO::PARAM_STR, $length = 0, $driverOptions = array());
  37. /**
  38. * Retrieves the bound parameters array when key is null and returns it by reference. If a key is provided then that item is
  39. * returned.
  40. *
  41. * @param mixed $key The bounded variable key to retrieve.
  42. *
  43. * @return mixed
  44. *
  45. * @since 12.1
  46. */
  47. public function &getBounded($key = null);
  48. }