[ Index ] |
|
Code source de Symfony 1.0.0 |
1 <?php 2 /* 3 * $Id: MssqlPlatform.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 include_once 'propel/engine/database/model/Domain.php'; 24 25 /** 26 * MS SQL Platform implementation. 27 * 28 * @author Hans Lellelid <hans@xmpl.org> (Propel) 29 * @author Martin Poeschl <mpoeschl@marmot.at> (Torque) 30 * @version $Revision: 256 $ 31 * @package propel.engine.platform 32 */ 33 class MssqlPlatform extends DefaultPlatform { 34 35 /** 36 * Initializes db specific domain mapping. 37 */ 38 protected function initialize() 39 { 40 parent::initialize(); 41 $this->setSchemaDomainMapping(new Domain(PropelTypes::INTEGER, "INT")); 42 $this->setSchemaDomainMapping(new Domain(PropelTypes::BOOLEAN, "INT")); 43 $this->setSchemaDomainMapping(new Domain(PropelTypes::DOUBLE, "FLOAT")); 44 $this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARCHAR, "TEXT")); 45 $this->setSchemaDomainMapping(new Domain(PropelTypes::CLOB, "TEXT")); 46 $this->setSchemaDomainMapping(new Domain(PropelTypes::DATE, "DATETIME")); 47 $this->setSchemaDomainMapping(new Domain(PropelTypes::BU_DATE, "DATETIME")); 48 $this->setSchemaDomainMapping(new Domain(PropelTypes::TIME, "DATETIME")); 49 $this->setSchemaDomainMapping(new Domain(PropelTypes::TIMESTAMP, "DATETIME")); 50 $this->setSchemaDomainMapping(new Domain(PropelTypes::BU_TIMESTAMP, "DATETIME")); 51 $this->setSchemaDomainMapping(new Domain(PropelTypes::BINARY, "BINARY(7132)")); 52 $this->setSchemaDomainMapping(new Domain(PropelTypes::VARBINARY, "IMAGE")); 53 $this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARBINARY, "IMAGE")); 54 $this->setSchemaDomainMapping(new Domain(PropelTypes::BLOB, "IMAGE")); 55 } 56 57 /** 58 * @see Platform#getMaxColumnNameLength() 59 */ 60 public function getMaxColumnNameLength() 61 { 62 return 128; 63 } 64 65 /** 66 * @return Explicitly returns <code>NULL</code> if null values are 67 * allowed (as recomended by Microsoft). 68 * @see Platform#getNullString(boolean) 69 */ 70 public function getNullString($notNull) 71 { 72 return ($notNull ? "NOT NULL" : "NULL"); 73 } 74 75 /** 76 * @see Platform::supportsNativeDeleteTrigger() 77 */ 78 public function supportsNativeDeleteTrigger() 79 { 80 return true; 81 } 82 83 /** 84 * @see Platform::hasSize(String) 85 */ 86 public function hasSize($sqlType) 87 { 88 return !("INT" == $sqlType || "TEXT" == $sqlType); 89 } 90 91 /** 92 * @see Platform::quoteIdentifier() 93 */ 94 public function quoteIdentifier($text) 95 { 96 return '[' . $text . ']'; 97 } 98 99 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Fri Mar 16 22:42:14 2007 | par Balluche grâce à PHPXref 0.7 |