[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/vendor/creole/drivers/odbc/adapters/ -> ODBCAdapter.php (source)

   1  <?php
   2  /*
   3   *  $Id: ODBCAdapter.php,v 1.3 2005/10/17 19:03:51 dlawson_mi Exp $
   4   *
   5   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   6   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   7   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   8   * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   9   * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  10   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  11   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  12   * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  13   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  14   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16   *
  17   * This software consists of voluntary contributions made by many individuals
  18   * and is licensed under the LGPL. For more information please see
  19   * <http://creole.phpdb.org>.
  20   */
  21  
  22  /**
  23   * Default class for ODBC driver-specific behavior.
  24   *
  25   * @author    Dave Lawson <dlawson@masterytech.com>
  26   * @version   $Revision: 1.3 $
  27   * @package   creole.drivers.odbc
  28   */
  29  class ODBCAdapter
  30  {
  31      /**
  32       * Returns true if column case is preserved in the database when a table
  33       * is first created. Returns false if table does not preserve case (i.e.
  34       * ProductID => PRODUCTID).
  35       *
  36       * @return boolean
  37       */
  38      public function preservesColumnCase()
  39      {
  40          return true;
  41      }
  42  
  43      /**
  44       * Returns true if prepared statements should be emulated. This
  45       * might be useful if your driver does not support (or has trouble with)
  46       * prepared statements.
  47       * 
  48       * @return boolean
  49       */
  50      public function emulatePrepareStmt()
  51      {
  52          return false;
  53      }
  54      
  55      /**
  56       * Returns true if ODBC driver supports LIMIT/OFFSET via SQL.
  57       *
  58       * @return boolean
  59       */
  60      public function hasLimitOffset()
  61      {
  62          return false;
  63      }
  64  
  65      /**
  66       * @see Connection::applyLimit()
  67       */
  68      public function applyLimit(&$sql, $offset, $limit)
  69      {
  70      }
  71  
  72      /**
  73       * @see PreparedStatementCommon::escape()
  74       */
  75      public function escape($str)
  76      {
  77          // use this instead of magic_quotes_sybase + addslashes(),
  78          // just in case multiple RDBMS being used at the same time
  79          return str_replace("'", "''", $str);
  80      }
  81  
  82      /**
  83       * Returns an instance of the default resultset.
  84       *
  85       * @return boolean
  86       */
  87      public function createResultSet($conn, $odbcresult, $fetchmode)
  88      {
  89          require_once 'creole/drivers/odbc/ODBCResultSet.php';
  90          return new ODBCResultSet($conn, $odbcresult, $fetchmode);
  91      }
  92  
  93      /**
  94       * Returns the default ODBCIdGenerator for emulating sequences.
  95       *
  96       * @return ODBCIdGenerator
  97       */
  98      public function getIdGenerator($conn)
  99      {
 100          require_once 'creole/drivers/odbc/ODBCIdGenerator.php';
 101          return new ODBCIdGenerator($conn);
 102      }
 103  
 104      /**
 105       * Returns true if driver support transactions.
 106       * 
 107       * @return boolean
 108       */
 109      public function supportsTransactions()
 110      {
 111          return true;
 112      }
 113  }
 114  
 115  ?>


Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7