[ Index ] |
|
Code source de Symfony 1.0.0 |
1 <?php 2 /* 3 * $Id: Platform.php 258 2005-11-07 16:12:09Z hans $ 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 /** 23 * Interface for RDBMS platform specific behaviour. 24 * 25 * @author Hans Lellelid <hans@xmpl.org> (Propel) 26 * @author Martin Poeschl <mpoeschl@marmot.at> (Torque) 27 * @version $Revision: 258 $ 28 * @package propel.engine.platform 29 */ 30 interface Platform { 31 32 /** constant for native id method */ 33 const IDENTITY = "identity"; 34 35 /** constant for native id method */ 36 const SEQUENCE = "sequence"; 37 38 /** 39 * Returns the short name of the database type that this platform represents. 40 * For example MysqlPlatform->getDatabaseType() returns 'mysql'. 41 * @return string 42 */ 43 public function getDatabaseType(); 44 45 /** 46 * Returns the native IdMethod (sequence|identity) 47 * 48 * @return string The native IdMethod (Platform:IDENTITY, Platform::SEQUENCE). 49 */ 50 public function getNativeIdMethod(); 51 52 /** 53 * Returns the max column length supported by the db. 54 * 55 * @return int The max column length 56 */ 57 public function getMaxColumnNameLength(); 58 59 /** 60 * Returns the db specific domain for a jdbcType. 61 * 62 * @param string $creoleType the creole type name. 63 * @return Domain The db specific domain. 64 */ 65 public function getDomainForType($creoleType); 66 67 /** 68 * @return string The RDBMS-specific SQL fragment for <code>NULL</code> 69 * or <code>NOT NULL</code>. 70 */ 71 public function getNullString($notNull); 72 73 /** 74 * @return The RDBMS-specific SQL fragment for autoincrement. 75 */ 76 public function getAutoIncrement(); 77 78 /** 79 * Returns if the RDBMS-specific SQL type has a size attribute. 80 * 81 * @param string $sqlType the SQL type 82 * @return boolean True if the type has a size attribute 83 */ 84 public function hasSize($sqlType); 85 86 /** 87 * Returns if the RDBMS-specific SQL type has a scale attribute. 88 * 89 * @param string $sqlType the SQL type 90 * @return boolean True if the type has a scale attribute 91 */ 92 public function hasScale($sqlType); 93 94 /** 95 * Escape the string for RDBMS. 96 * @param string $text 97 * @return string 98 */ 99 public function escapeText($text); 100 101 /** 102 * Quotes identifiers used in database SQL. 103 * @param string $text 104 * @return string Quoted identifier. 105 */ 106 public function quoteIdentifier($text); 107 108 /** 109 * Whether RDBMS supports native ON DELETE triggers (e.g. ON DELETE CASCADE). 110 * @return boolean 111 */ 112 public function supportsNativeDeleteTrigger(); 113 114 /** 115 * Returns the boolean value for the RDBMS. 116 * 117 * This value should match the boolean value that is set 118 * when using Creole's PreparedStatement::setBoolean(). 119 * 120 * This function is used to set default column values when building 121 * SQL. 122 * 123 * @param mixed $tf A boolean or string representation of boolean ('y', 'true'). 124 * @return mixed 125 */ 126 public function getBooleanString($tf); 127 128 }
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 |