[ Index ]

PHP Cross Reference of YOURLS

title

Body

[close]

/includes/vendor/aura/sql/src/ -> PdoInterface.php (source)

   1  <?php
   2  /**
   3   *
   4   * This file is part of Aura for PHP.
   5   *
   6   * @license https://opensource.org/licenses/MIT MIT
   7   *
   8   */
   9  namespace Aura\Sql;
  10  
  11  use PDO;
  12  
  13  /**
  14   *
  15   * An interface to the native PDO object.
  16   *
  17   * @package Aura.Sql
  18   *
  19   */
  20  interface PdoInterface
  21  {
  22      /**
  23       *
  24       * Begins a transaction and turns off autocommit mode.
  25       *
  26       * @return bool True on success, false on failure.
  27       *
  28       * @see http://php.net/manual/en/pdo.begintransaction.php
  29       *
  30       */
  31      public function beginTransaction();
  32  
  33      /**
  34       *
  35       * Commits the existing transaction and restores autocommit mode.
  36       *
  37       * @return bool True on success, false on failure.
  38       *
  39       * @see http://php.net/manual/en/pdo.commit.php
  40       *
  41       */
  42      public function commit();
  43  
  44      /**
  45       *
  46       * Gets the most recent error code.
  47       *
  48       * @return mixed
  49       *
  50       */
  51      public function errorCode();
  52  
  53      /**
  54       *
  55       * Gets the most recent error info.
  56       *
  57       * @return array
  58       *
  59       */
  60      public function errorInfo();
  61  
  62      /**
  63       *
  64       * Executes an SQL statement and returns the number of affected rows.
  65       *
  66       * @param string $statement The SQL statement to execute.
  67       *
  68       * @return int The number of rows affected.
  69       *
  70       * @see http://php.net/manual/en/pdo.exec.php
  71       *
  72       */
  73      public function exec($statement);
  74  
  75      /**
  76       *
  77       * Gets a PDO attribute value.
  78       *
  79       * @param mixed $attribute The PDO::ATTR_* constant.
  80       *
  81       * @return mixed The value for the attribute.
  82       *
  83       */
  84      public function getAttribute($attribute);
  85  
  86      /**
  87       *
  88       * Is a transaction currently active?
  89       *
  90       * @return bool
  91       *
  92       * @see http://php.net/manual/en/pdo.intransaction.php
  93       *
  94       */
  95      public function inTransaction();
  96  
  97      /**
  98       *
  99       * Returns the last inserted autoincrement sequence value.
 100       *
 101       * @param string $name The name of the sequence to check; typically needed
 102       * only for PostgreSQL, where it takes the form of `<table>_<column>_seq`.
 103       *
 104       * @return string
 105       *
 106       * @see http://php.net/manual/en/pdo.lastinsertid.php
 107       *
 108       */
 109      public function lastInsertId($name = null);
 110  
 111      /**
 112       *
 113       * Prepares an SQL statement for execution.
 114       *
 115       * @param string $statement The SQL statement to prepare for execution.
 116       *
 117       * @param array $options Set these attributes on the returned
 118       * PDOStatement.
 119       *
 120       * @return \PDOStatement
 121       *
 122       * @see http://php.net/manual/en/pdo.prepare.php
 123       *
 124       */
 125      public function prepare($statement, $options = null);
 126  
 127      /**
 128       *
 129       * Queries the database and returns a PDOStatement.
 130       *
 131       * @param string $statement The SQL statement to prepare and execute.
 132       *
 133       * @param mixed ...$fetch Optional fetch-related parameters.
 134       *
 135       * @return \PDOStatement
 136       *
 137       * @see http://php.net/manual/en/pdo.query.php
 138       *
 139       */
 140      public function query($statement, ...$fetch);
 141  
 142      /**
 143       *
 144       * Quotes a value for use in an SQL statement.
 145       *
 146       * @param mixed $value The value to quote.
 147       *
 148       * @param int $parameter_type A data type hint for the database driver.
 149       *
 150       * @return string The quoted value.
 151       *
 152       * @see http://php.net/manual/en/pdo.quote.php
 153       *
 154       */
 155      public function quote($value, $parameter_type = PDO::PARAM_STR);
 156  
 157      /**
 158       *
 159       * Rolls back the current transaction and restores autocommit mode.
 160       *
 161       * @return bool True on success, false on failure.
 162       *
 163       * @see http://php.net/manual/en/pdo.rollback.php
 164       *
 165       */
 166      public function rollBack();
 167  
 168      /**
 169       *
 170       * Sets a PDO attribute value.
 171       *
 172       * @param mixed $attribute The PDO::ATTR_* constant.
 173       *
 174       * @param mixed $value The value for the attribute.
 175       *
 176       * @return bool
 177       *
 178       */
 179      public function setAttribute($attribute, $value);
 180  
 181      /**
 182       *
 183       * Returns all currently available PDO drivers.
 184       *
 185       * @return array
 186       *
 187       */
 188      public static function getAvailableDrivers();
 189  }


Generated: Tue Jan 21 05:10:11 2025 Cross-referenced by PHPXref 0.7.1