本文整理匯總了PHP中Doctrine\DBAL\Platforms\AbstractPlatform::getVarcharTypeDeclarationSQL方法的典型用法代碼示例。如果您正苦於以下問題:PHP AbstractPlatform::getVarcharTypeDeclarationSQL方法的具體用法?PHP AbstractPlatform::getVarcharTypeDeclarationSQL怎麽用?PHP AbstractPlatform::getVarcharTypeDeclarationSQL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine\DBAL\Platforms\AbstractPlatform
的用法示例。
在下文中一共展示了AbstractPlatform::getVarcharTypeDeclarationSQL方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getSQLDeclaration
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
if ($platform->getName() === 'mysql') {
return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration) . " " . $platform->getCollationFieldDeclaration('utf8_bin');
}
return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration);
}
示例2: getSqlDeclaration
public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
$fieldDeclaration['length'] = 255;
$fieldDeclaration['notnull'] = false;
$fieldDeclaration['default'] = null;
return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration);
}
示例3: getSQLDeclaration
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
$fieldDeclaration['length'] = 25;
$fieldDeclaration['fixed'] = true;
$fieldDeclaration['notnull'] = true;
return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration);
}
示例4: getSQLDeclaration
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
if (!isset($fieldDeclaration['length'])) {
$fieldDeclaration['length'] = 32;
}
return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration);
}
示例5: getSQLDeclaration
/**
* {@inheritdoc}
* @param array $fieldDeclaration
* @param AbstractPlatform $platform
* @return
*/
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
if (empty($fieldDeclaration['length'])) {
$fieldDeclaration['length'] = Path::MAX_LENGTH;
}
$type = $platform->getVarcharTypeDeclarationSQL($fieldDeclaration);
return $type;
}
示例6: getSQLDeclaration
/**
* {@inheritdoc}
* @param array $fieldDeclaration
* @param AbstractPlatform $platform
* @return string
*/
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
$fieldDeclaration['length'] = 20;
$fieldDeclaration['fixed'] = true;
$sql = $platform->getVarcharTypeDeclarationSQL($fieldDeclaration);
//todo: check if this is sane, at least
$sql .= ' COLLATE ascii_general_ci';
return $sql;
}
示例7: getSQLDeclaration
/**
* {@inheritdoc}
*/
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration);
}
示例8: getSQLDeclaration
/**
* @param array $fieldDeclaration
* @param AbstractPlatform $platform
* @return string
*/
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
return $platform->getVarcharTypeDeclarationSQL(array_merge($fieldDeclaration, array('length' => 1, 'fixed' => true)));
}
示例9: getSqlDeclaration
/**
* @deprecated
*/
public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
return $platform->getVarcharTypeDeclarationSQL(array('length' => 3, 'fixed' => TRUE));
}
示例10: getSQLDeclaration
/**
* Gets the SQL declaration snippet for a field of this type.
*
* @param array $fieldDeclaration The field declaration.
* @param AbstractPlatform $platform The currently used database platform.
*
* @return string
*/
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
return $this->getValueType() === self::ENUM_INT ? $platform->getIntegerTypeDeclarationSQL($fieldDeclaration) : $platform->getVarcharTypeDeclarationSQL($fieldDeclaration);
}
示例11: getSqlDeclaration
public function getSqlDeclaration(array $fieldDeclaration, \Doctrine\DBAL\Platforms\AbstractPlatform $platform)
{
return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration);
}
示例12: getSQLDeclaration
/**
* {@inheritdoc}
*
* @param array $fieldDeclaration
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
*/
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
$length = isset($fieldDeclaration['length']) ? $fieldDeclaration['length'] : 7;
$field = ['length' => $length, 'fixed' => true, 'collation' => 'utf8_bin'];
return $platform->getVarcharTypeDeclarationSQL($field) . ' ' . $platform->getColumnCollationDeclarationSQL('utf8_bin');
}
示例13: getSQLDeclaration
/**
* {@inheritdoc}
*/
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
$fieldDeclaration['length'] = static::DATE_INTERVAL_TYPE_FIELD_LENGTH;
$fieldDeclaration['fixed'] = static::DATE_INTERVAL_TYPE_FIELD_FIXED;
return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration);
}