[ Index ]
 

Code source de Symfony 1.0.0

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

title

Body

[fermer]

/lib/vendor/propel/adapter/ -> DBSQLite.php (source)

   1  <?php
   2  
   3  /*
   4   *  $Id: DBSQLite.php 286 2005-11-25 17:12:29Z hans $
   5   *
   6   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   7   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   8   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   9   * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  10   * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  11   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  12   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  13   * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  14   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  15   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  16   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  17   *
  18   * This software consists of voluntary contributions made by many individuals
  19   * and is licensed under the LGPL. For more information please see
  20   * <http://propel.phpdb.org>.
  21   */
  22  
  23  require_once 'propel/adapter/DBAdapter.php';
  24  
  25  /**
  26   * This is used in order to connect to a SQLite database.
  27   *
  28   * @author Hans Lellelid <hans@xmpl.org>
  29   * @version $Revision: 286 $
  30   * @package propel.adapter
  31   */
  32  class DBSQLite extends DBAdapter {
  33  
  34      /**
  35       * This method is used to ignore case.
  36       *
  37       * @param in The string to transform to upper case.
  38       * @return The upper case string.
  39       */
  40      public function toUpperCase($in)
  41      {
  42          return 'UPPER(' . $in . ')';
  43      }
  44  
  45      /**
  46       * This method is used to ignore case.
  47       *
  48       * @param in The string whose case to ignore.
  49       * @return The string in a case that can be ignored.
  50       */
  51      public function ignoreCase($in)
  52      {
  53          return 'UPPER(' . $in . ')';
  54      }
  55          
  56      /**
  57       * Returns SQL which concatenates the second string to the first.
  58       *
  59       * @param string String to concatenate.
  60       * @param string String to append.
  61       * @return string 
  62       */
  63      public function concatString($s1, $s2)
  64      {
  65          return "($s1 || $s2)";
  66      }
  67  
  68      /**
  69       * Returns SQL which extracts a substring.
  70       *
  71       * @param string String to extract from.
  72       * @param int Offset to start from.
  73       * @param int Number of characters to extract.
  74       * @return string 
  75       */
  76      public function subString($s, $pos, $len)
  77      {
  78          return "substr($s, $pos, $len)";
  79      }
  80  
  81      /**
  82       * Returns SQL which calculates the length (in chars) of a string.
  83       *
  84       * @param string String to calculate length of.
  85       * @return string 
  86       */
  87      public function strLength($s)
  88      {
  89          return "length($s)";
  90      }
  91   
  92      /**
  93       * Locks the specified table.
  94       *
  95       * @param Connection $con The Creole connection to use.
  96       * @param string $table The name of the table to lock.
  97       * @throws SQLException No Statement could be created or
  98       * executed.
  99       */
 100      public function lockTable(Connection $con, $table)
 101      {        
 102      }
 103  
 104      /**
 105       * Unlocks the specified table.
 106       *
 107       * @param Connection $con The Creole connection to use.
 108       * @param string $table The name of the table to unlock.
 109       * @throws SQLException No Statement could be created or
 110       * executed.
 111       */
 112      public function unlockTable(Connection $con, $table)
 113      {        
 114      }
 115      
 116      /**
 117       * @see DBAdapter::quoteIdentifier()
 118       */
 119  	public function quoteIdentifier($text)
 120      {
 121          return '[' . $text . ']';
 122      }
 123  
 124  }


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