TYPO3 API  SVNRelease
DatabaseConnection.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /**
00004  * The Auth_OpenID_DatabaseConnection class, which is used to emulate
00005  * a PEAR database connection.
00006  *
00007  * @package OpenID
00008  * @author JanRain, Inc. <openid@janrain.com>
00009  * @copyright 2005-2008 Janrain, Inc.
00010  * @license http://www.apache.org/licenses/LICENSE-2.0 Apache
00011  */
00012 
00013 /**
00014  * An empty base class intended to emulate PEAR connection
00015  * functionality in applications that supply their own database
00016  * abstraction mechanisms.  See {@link Auth_OpenID_SQLStore} for more
00017  * information.  You should subclass this class if you need to create
00018  * an SQL store that needs to access its database using an
00019  * application's database abstraction layer instead of a PEAR database
00020  * connection.  Any subclass of Auth_OpenID_DatabaseConnection MUST
00021  * adhere to the interface specified here.
00022  *
00023  * @package OpenID
00024  */
00025 class Auth_OpenID_DatabaseConnection {
00026     /**
00027      * Sets auto-commit mode on this database connection.
00028      *
00029      * @param bool $mode True if auto-commit is to be used; false if
00030      * not.
00031      */
00032     function autoCommit($mode)
00033     {
00034     }
00035 
00036     /**
00037      * Run an SQL query with the specified parameters, if any.
00038      *
00039      * @param string $sql An SQL string with placeholders.  The
00040      * placeholders are assumed to be specific to the database engine
00041      * for this connection.
00042      *
00043      * @param array $params An array of parameters to insert into the
00044      * SQL string using this connection's escaping mechanism.
00045      *
00046      * @return mixed $result The result of calling this connection's
00047      * internal query function.  The type of result depends on the
00048      * underlying database engine.  This method is usually used when
00049      * the result of a query is not important, like a DDL query.
00050      */
00051     function query($sql, $params = array())
00052     {
00053     }
00054 
00055     /**
00056      * Starts a transaction on this connection, if supported.
00057      */
00058     function begin()
00059     {
00060     }
00061 
00062     /**
00063      * Commits a transaction on this connection, if supported.
00064      */
00065     function commit()
00066     {
00067     }
00068 
00069     /**
00070      * Performs a rollback on this connection, if supported.
00071      */
00072     function rollback()
00073     {
00074     }
00075 
00076     /**
00077      * Run an SQL query and return the first column of the first row
00078      * of the result set, if any.
00079      *
00080      * @param string $sql An SQL string with placeholders.  The
00081      * placeholders are assumed to be specific to the database engine
00082      * for this connection.
00083      *
00084      * @param array $params An array of parameters to insert into the
00085      * SQL string using this connection's escaping mechanism.
00086      *
00087      * @return mixed $result The value of the first column of the
00088      * first row of the result set.  False if no such result was
00089      * found.
00090      */
00091     function getOne($sql, $params = array())
00092     {
00093     }
00094 
00095     /**
00096      * Run an SQL query and return the first row of the result set, if
00097      * any.
00098      *
00099      * @param string $sql An SQL string with placeholders.  The
00100      * placeholders are assumed to be specific to the database engine
00101      * for this connection.
00102      *
00103      * @param array $params An array of parameters to insert into the
00104      * SQL string using this connection's escaping mechanism.
00105      *
00106      * @return array $result The first row of the result set, if any,
00107      * keyed on column name.  False if no such result was found.
00108      */
00109     function getRow($sql, $params = array())
00110     {
00111     }
00112 
00113     /**
00114      * Run an SQL query with the specified parameters, if any.
00115      *
00116      * @param string $sql An SQL string with placeholders.  The
00117      * placeholders are assumed to be specific to the database engine
00118      * for this connection.
00119      *
00120      * @param array $params An array of parameters to insert into the
00121      * SQL string using this connection's escaping mechanism.
00122      *
00123      * @return array $result An array of arrays representing the
00124      * result of the query; each array is keyed on column name.
00125      */
00126     function getAll($sql, $params = array())
00127     {
00128     }
00129 }
00130 
00131 ?>