本文整理汇总了PHP中DefaultPlatform类的典型用法代码示例。如果您正苦于以下问题:PHP DefaultPlatform类的具体用法?PHP DefaultPlatform怎么用?PHP DefaultPlatform使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DefaultPlatform类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDropIndexDDL
/**
* Overrides the implementation from DefaultPlatform
*
* @author Niklas Närhinen <niklas@narhinen.net>
* @return string
* @see DefaultPlatform::getDropIndexDDL
*/
public function getDropIndexDDL(Index $index)
{
if ($index instanceof Unique) {
$pattern = "\n ALTER TABLE %s DROP CONSTRAINT %s;\n ";
return sprintf($pattern, $this->quoteIdentifier($index->getTable()->getName()), $this->quoteIdentifier($index->getName()));
} else {
return parent::getDropIndexDDL($index);
}
}
示例2: getBooleanString
/**
* @see Platform::getBooleanString()
*/
public function getBooleanString($b)
{
// parent method does the checking for allowes tring
// representations & returns integer
$b = parent::getBooleanString($b);
return $b ? "'t'" : "'f'";
}
示例3: disconnectedEscapeText
/**
* Escape the string for RDBMS.
* @param string $text
* @return string
*/
public function disconnectedEscapeText($text)
{
if (function_exists('sqlite_escape_string')) {
return sqlite_escape_string($text);
} else {
return parent::disconnectedEscapeText($text);
}
}
示例4: initialize
/**
* Initializes db specific domain mapping.
*/
protected function initialize()
{
parent::initialize();
$this->setSchemaDomainMapping(new Domain(PropelTypes::NUMERIC, "DECIMAL"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARCHAR, "MEDIUMTEXT"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::DATE, "DATETIME"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::BINARY, "BLOB"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::VARBINARY, "MEDIUMBLOB"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARBINARY, "LONGBLOB"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::BLOB, "LONGBLOB"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::CLOB, "LONGTEXT"));
}
示例5: initialize
/**
* Initializes db specific domain mapping.
*/
protected function initialize()
{
parent::initialize();
$this->setSchemaDomainMapping(new Domain(PropelTypes::BOOLEAN, "TINYINT"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::NUMERIC, "DECIMAL"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARCHAR, "TEXT"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::BINARY, "BLOB"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::VARBINARY, "MEDIUMBLOB"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARBINARY, "LONGBLOB"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::BLOB, "LONGBLOB"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::CLOB, "LONGTEXT"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::TIMESTAMP, "DATETIME"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::OBJECT, "TEXT"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::PHP_ARRAY, "TEXT"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::ENUM, "TINYINT"));
}
示例6: initialize
/**
* Initializes db specific domain mapping.
*/
protected function initialize()
{
parent::initialize();
$this->setSchemaDomainMapping(new Domain(PropelTypes::INTEGER, "INT"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::BOOLEAN, "INT"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::DOUBLE, "FLOAT"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARCHAR, "TEXT"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::CLOB, "TEXT"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::DATE, "DATETIME"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::BU_DATE, "DATETIME"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::TIME, "DATETIME"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::TIMESTAMP, "DATETIME"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::BU_TIMESTAMP, "DATETIME"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::BINARY, "BINARY(7132)"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::VARBINARY, "IMAGE"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARBINARY, "IMAGE"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::BLOB, "IMAGE"));
}
示例7: initialize
/**
* Initializes db specific domain mapping.
*/
protected function initialize()
{
parent::initialize();
$this->setSchemaDomainMapping(new Domain(PropelTypes::BOOLEAN, "NUMBER", "1", "0"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::TINYINT, "NUMBER", "3", "0"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::SMALLINT, "NUMBER", "5", "0"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::INTEGER, "NUMBER"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::BIGINT, "NUMBER", "20", "0"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::REAL, "NUMBER"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::DOUBLE, "FLOAT"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::DECIMAL, "NUMBER"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::NUMERIC, "NUMBER"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::VARCHAR, "VARCHAR2"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARCHAR, "VARCHAR2", "2000"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::TIME, "DATE"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::TIMESTAMP, "DATE"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::BINARY, "LONG RAW"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::VARBINARY, "BLOB"));
$this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARBINARY, "LONG RAW"));
}
示例8: getColumnBindingPHP
public function getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab = "\t\t\t")
{
// FIXME - This is a temporary hack to get around apparent bugs w/ PDO+MYSQL
// See http://pecl.php.net/bugs/bug.php?id=9919
if ($column->getPDOType() == PDO::PARAM_BOOL) {
return sprintf("\n%s\$stmt->bindValue(%s, (int) %s, PDO::PARAM_INT);", $tab, $identifier, $columnValueAccessor);
}
return parent::getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab);
}
示例9: getColumnBindingPHP
/**
* Get the PHP snippet for binding a value to a column.
* Warning: duplicates logic from DBOracle::bindValue().
* Any code modification here must be ported there.
*/
public function getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab = "\t\t\t")
{
if ($column->getPDOType() == PropelTypes::CLOB_EMU) {
return sprintf("%s\$stmt->bindParam(%s, %s, %s, strlen(%s));\r\n", $tab, $identifier, $columnValueAccessor, PropelTypes::getPdoTypeString($column->getType()), $columnValueAccessor);
}
return parent::getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab);
}
示例10: getAddPrimaryKeyDDL
public function getAddPrimaryKeyDDL(Table $table)
{
if (is_array($table->getPrimaryKey()) && count($table->getPrimaryKey())) {
return parent::getAddPrimaryKeyDDL($table);
}
}