本文整理匯總了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;
}