本文整理汇总了PHP中DatabaseCompatibilityUtil::resolveUnsignedByHintType方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseCompatibilityUtil::resolveUnsignedByHintType方法的具体用法?PHP DatabaseCompatibilityUtil::resolveUnsignedByHintType怎么用?PHP DatabaseCompatibilityUtil::resolveUnsignedByHintType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseCompatibilityUtil
的用法示例。
在下文中一共展示了DatabaseCompatibilityUtil::resolveUnsignedByHintType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resolveForeignKeyColumnMetadata
public static function resolveForeignKeyColumnMetadata($name, $relatedModelClass = null)
{
if (!isset($name)) {
if (isset($relatedModelClass)) {
$name = static::resolveForeignKeyNameByModelName($relatedModelClass);
} else {
throw new NotSupportedException();
}
}
// this is foreign key, we force it to be assumed unsigned.
$unsigned = DatabaseCompatibilityUtil::resolveUnsignedByHintType('integer', false, $name);
return static::resolveColumnMetadataByHintType($name, 'integer', null, $unsigned);
}
示例2: getReservedColumnMetadata
protected static function getReservedColumnMetadata()
{
$columns = array();
$reservedColumnsTypes = array('status' => 'integer', 'serializedMessages' => 'string', 'analysisStatus' => 'integer', 'serializedAnalysisMessages' => 'string');
foreach ($reservedColumnsTypes as $columnName => $type) {
$length = null;
$unsigned = null;
if ($type === 'string') {
// populate the proper type given it would be 1024 char string depending on db type.
RedBeanModelMemberRulesToColumnAdapter::resolveStringTypeAndLengthByMaxLength($type, $length, 1024);
} else {
// forcing integers to be unsigned
$unsigned = DatabaseCompatibilityUtil::resolveUnsignedByHintType($type, false);
}
// last argument is false because we do not want these column names to be resolved to lower characters
$columns[] = RedBeanModelMemberToColumnUtil::resolveColumnMetadataByHintType($columnName, $type, $length, $unsigned, null, null, null, false);
}
return $columns;
}