本文整理匯總了PHP中Doctrine\DBAL\Types\Type::getName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Type::getName方法的具體用法?PHP Type::getName怎麽用?PHP Type::getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine\DBAL\Types\Type
的用法示例。
在下文中一共展示了Type::getName方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getTypeByDoctrineType
public static function getTypeByDoctrineType(Type $type)
{
$mapping = array_flip(self::$mapping);
if (isset($mapping[$type->getName()])) {
return $mapping[$type->getName()];
} else {
return TableInterface::TYPE_VARCHAR;
}
}
示例2: doctrineColumnLookup
public function doctrineColumnLookup($col_lookup)
{
if (isset($this->options['expr']) && isset($col_lookup[$this->options['expr']])) {
/**
* @var $col Column
*/
$col = $col_lookup[$this->options['expr']];
$this->type = $col->getType();
$this->typeName = self::simplifyTypeName($this->type->getName());
}
}
示例3: setType
/**
* {@inheritdoc}
*/
public function setType(Type $type)
{
if ($this->constructed) {
$this->setOptions([OroOptions::KEY => [ExtendOptionsManager::TYPE_OPTION => $type->getName()]]);
}
return parent::setType($type);
}
示例4: isCommentedDoctrineType
/**
* {@inheritdoc}
*/
public function isCommentedDoctrineType(Type $doctrineType)
{
if ($doctrineType->getName() === Type::BOOLEAN) {
// We require a commented boolean type in order to distinguish between boolean and smallint
// as both (have to) map to the same native type.
return true;
}
return parent::isCommentedDoctrineType($doctrineType);
}
示例5: getDoctrineTypeComment
/**
* Get the comment to append to a column comment that helps parsing this type in reverse engineering.
*
* @param Type $doctrineType
* @return string
*/
public function getDoctrineTypeComment(Type $doctrineType)
{
return '(DC2Type:' . $doctrineType->getName() . ')';
}
示例6: testGetName
public function testGetName()
{
$this->assertEquals('str_uuid', $this->type->getName());
}
示例7: value
private function value(EntityManager $em, Type $type, $value)
{
$platform = $em->getConnection()->getDatabasePlatform();
switch ($type->getName()) {
case Type::BOOLEAN:
return $type->convertToPHPValue($value, $platform);
// json supports boolean values
// json supports boolean values
default:
return $type->convertToDatabaseValue($value, $platform);
}
}