[ Index ]
 

Code source de Symfony 1.0.0

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

title

Body

[fermer]

/lib/vendor/propel-generator/classes/propel/engine/platform/ -> SqlitePlatform.php (source)

   1  <?php
   2  /*
   3   *  $Id: SqlitePlatform.php 137 2005-11-17 14:11:19Z fabien $
   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://propel.phpdb.org>.
  20   */
  21  
  22  require_once 'propel/engine/platform/DefaultPlatform.php';
  23  
  24  /**
  25   * SQLite Platform implementation.
  26   *
  27   * @author Hans Lellelid <hans@xmpl.org>
  28   * @version $Revision: 268 $
  29   * @package propel.engine.platform
  30   */
  31  class SqlitePlatform extends DefaultPlatform {
  32  
  33      /**
  34       * Initializes db specific domain mapping.
  35       */
  36      protected function initialize()
  37      {
  38          parent::initialize();
  39          $this->setSchemaDomainMapping(new Domain(PropelTypes::NUMERIC, "DECIMAL"));
  40          $this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARCHAR, "MEDIUMTEXT"));
  41          $this->setSchemaDomainMapping(new Domain(PropelTypes::DATE, "DATETIME"));
  42          $this->setSchemaDomainMapping(new Domain(PropelTypes::BINARY, "BLOB"));
  43          $this->setSchemaDomainMapping(new Domain(PropelTypes::VARBINARY, "MEDIUMBLOB"));
  44          $this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARBINARY, "LONGBLOB"));
  45          $this->setSchemaDomainMapping(new Domain(PropelTypes::BLOB, "LONGBLOB"));
  46          $this->setSchemaDomainMapping(new Domain(PropelTypes::CLOB, "LONGTEXT"));
  47      }
  48  
  49      /**
  50       * @see Platform#getAutoIncrement()
  51       * @link http://www.sqlite.org/autoinc.html
  52       */
  53      public function getAutoIncrement()
  54      {
  55          
  56          return "PRIMARY KEY";
  57      }
  58  
  59      /**
  60       * @see Platform#getMaxColumnNameLength()
  61       */
  62      public function getMaxColumnNameLength()
  63      {
  64          return 1024;
  65      }
  66      
  67      /**
  68       * @see Platform#hasSize(String)
  69       */
  70      public function hasSize($sqlType) {
  71          return !("MEDIUMTEXT" == $sqlType || "LONGTEXT" == $sqlType
  72                  || "BLOB" == $sqlType || "MEDIUMBLOB" == $sqlType
  73                  || "LONGBLOB" == $sqlType);
  74      }
  75      
  76      /**
  77       * Escape the string for RDBMS.
  78       * @param string $text
  79       * @return string
  80       */ 
  81      public function escapeText($text) {
  82          return sqlite_escape_string($text);
  83      }
  84  
  85      /**
  86       * @see Platform::quoteIdentifier()
  87       */
  88  	public function quoteIdentifier($text)
  89      {
  90          return '[' . $text . ']';
  91      }
  92  }


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