[ 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/ -> DBPostgres.php (source)

   1  <?php
   2  
   3  /*
   4   *  $Id: DBPostgres.php 64 2005-05-13 02:43:56Z root $
   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 to connect to PostgresQL databases.
  27   *
  28   * <a href="http://www.pgsql.org">http://www.pgsql.org</a>
  29   *
  30   * @author Hans Lellelid <hans@xmpl.org> (Propel)
  31   * @author Hakan Tandogan <hakan42@gmx.de> (Torque)
  32   * @version $Revision: 64 $
  33   * @package propel.adapter
  34   */
  35  class DBPostgres extends DBAdapter {
  36  
  37      /**
  38       * This method is used to ignore case.
  39       *
  40       * @param string $in The string to transform to upper case.
  41       * @return string The upper case string.
  42       */
  43      public function toUpperCase($in)
  44      {
  45          return "UPPER(" . $in . ")";
  46      }
  47  
  48      /**
  49       * This method is used to ignore case.
  50       *
  51       * @param in The string whose case to ignore.
  52       * @return The string in a case that can be ignored.
  53       */
  54      public function ignoreCase($in)
  55      {
  56          return "UPPER(" . $in . ")";
  57      }
  58  
  59      /**
  60       * Returns SQL which concatenates the second string to the first.
  61       *
  62       * @param string String to concatenate.
  63       * @param string String to append.
  64       * @return string 
  65       */
  66      public function concatString($s1, $s2)
  67      {
  68          return "($s1 || $s2)";
  69      }
  70  
  71      /**
  72       * Returns SQL which extracts a substring.
  73       *
  74       * @param string String to extract from.
  75       * @param int Offset to start from.
  76       * @param int Number of characters to extract.
  77       * @return string 
  78       */
  79      public function subString($s, $pos, $len)
  80      {
  81          return "substring($s from $pos" . ($len > -1 ? "for $len" : "") . ")";
  82      }
  83  
  84      /**
  85       * Returns SQL which calculates the length (in chars) of a string.
  86       *
  87       * @param string String to calculate length of.
  88       * @return string 
  89       */
  90      public function strLength($s)
  91      {
  92          return "char_length($s)";
  93      }
  94       
  95      /**
  96       * Locks the specified table.
  97       *
  98       * @param Connection $con The Creole connection to use.
  99       * @param string $table The name of the table to lock.
 100       * @exception SQLException No Statement could be created or executed.
 101       */
 102      public function lockTable(Connection $con, $table)
 103      {
 104      }
 105  
 106      /**
 107       * Unlocks the specified table.
 108       *
 109       * @param Connection $con The Creole connection to use.
 110       * @param string $table The name of the table to unlock.
 111       * @exception SQLException No Statement could be created or executed.
 112       */
 113      public function unlockTable(Connection $con, $table)
 114      {
 115      }
 116  
 117  }


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