[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/database/src/ -> StatementInterface.php (source)

   1  <?php
   2  /**
   3   * Part of the Joomla Framework Database Package
   4   *
   5   * @copyright  Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
   6   * @license    GNU General Public License version 2 or later; see LICENSE
   7   */
   8  
   9  namespace Joomla\Database;
  10  
  11  /**
  12   * Interface defining a query statement.
  13   *
  14   * This interface is a partial standalone implementation of PDOStatement.
  15   *
  16   * @since  2.0.0
  17   */
  18  interface StatementInterface
  19  {
  20      /**
  21       * Binds a parameter to the specified variable name.
  22       *
  23       * @param   string|integer  $parameter      Parameter identifier. For a prepared statement using named placeholders, this will be a parameter
  24       *                                          name of the form `:name`. For a prepared statement using question mark placeholders, this will be
  25       *                                          the 1-indexed position of the parameter.
  26       * @param   mixed           $variable       Name of the PHP variable to bind to the SQL statement parameter.
  27       * @param   string          $dataType       Constant corresponding to a SQL datatype, this should be the processed type from the QueryInterface.
  28       * @param   integer         $length         The length of the variable. Usually required for OUTPUT parameters.
  29       * @param   array           $driverOptions  Optional driver options to be used.
  30       *
  31       * @return  boolean
  32       *
  33       * @since   2.0.0
  34       */
  35  	public function bindParam($parameter, &$variable, string $dataType = ParameterType::STRING, ?int $length = null, ?array $driverOptions = null);
  36  
  37      /**
  38       * Closes the cursor, enabling the statement to be executed again.
  39       *
  40       * @return  void
  41       *
  42       * @since   2.0.0
  43       */
  44  	public function closeCursor(): void;
  45  
  46      /**
  47       * Fetches the SQLSTATE associated with the last operation on the statement handle.
  48       *
  49       * @return  string
  50       *
  51       * @since   2.0.0
  52       */
  53  	public function errorCode();
  54  
  55      /**
  56       * Fetches extended error information associated with the last operation on the statement handle.
  57       *
  58       * @return  array
  59       *
  60       * @since   2.0.0
  61       */
  62  	public function errorInfo();
  63  
  64      /**
  65       * Executes a prepared statement
  66       *
  67       * @param   array|null  $parameters  An array of values with as many elements as there are bound parameters in the SQL statement being executed.
  68       *
  69       * @return  boolean
  70       *
  71       * @since   2.0.0
  72       */
  73  	public function execute(?array $parameters = null);
  74  
  75      /**
  76       * Fetches the next row from a result set
  77       *
  78       * @param   integer|null  $fetchStyle         Controls how the next row will be returned to the caller. This value must be one of the
  79       *                                            FetchMode constants, defaulting to value of FetchMode::MIXED.
  80       * @param   integer       $cursorOrientation  For a StatementInterface object representing a scrollable cursor, this value determines which row
  81       *                                            will be returned to the caller. This value must be one of the FetchOrientation constants,
  82       *                                            defaulting to FetchOrientation::NEXT.
  83       * @param   integer       $cursorOffset       For a StatementInterface object representing a scrollable cursor for which the cursorOrientation
  84       *                                            parameter is set to FetchOrientation::ABS, this value specifies the absolute number of the row in
  85       *                                            the result set that shall be fetched. For a StatementInterface object representing a scrollable
  86       *                                            cursor for which the cursorOrientation parameter is set to FetchOrientation::REL, this value
  87       *                                            specifies the row to fetch relative to the cursor position before `fetch()` was called.
  88       *
  89       * @return  mixed  The return value of this function on success depends on the fetch type. In all cases, boolean false is returned on failure.
  90       *
  91       * @since   2.0.0
  92       */
  93  	public function fetch(?int $fetchStyle = null, int $cursorOrientation = FetchOrientation::NEXT, int $cursorOffset = 0);
  94  
  95      /**
  96       * Returns the number of rows affected by the last SQL statement.
  97       *
  98       * @return  integer
  99       *
 100       * @since   2.0.0
 101       */
 102  	public function rowCount(): int;
 103  
 104      /**
 105       * Sets the fetch mode to use while iterating this statement.
 106       *
 107       * @param   integer  $fetchMode  The fetch mode, must be one of the FetchMode constants.
 108       * @param   mixed    ...$args    Optional mode-specific arguments.
 109       *
 110       * @return  void
 111       *
 112       * @since   2.0.0
 113       */
 114  	public function setFetchMode(int $fetchMode, ...$args): void;
 115  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer