本文整理汇总了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);
}