当前位置: 首页>>代码示例>>PHP>>正文


PHP QType::Constant方法代码示例

本文整理汇总了PHP中QType::Constant方法的典型用法代码示例。如果您正苦于以下问题:PHP QType::Constant方法的具体用法?PHP QType::Constant怎么用?PHP QType::Constant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QType的用法示例。


在下文中一共展示了QType::Constant方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: AnalyzeTableColumn

 protected function AnalyzeTableColumn(QDatabaseFieldBase $objField, $objTable)
 {
     $objColumn = new QColumn();
     $objColumn->Name = $objField->Name;
     $objColumn->OwnerTable = $objTable;
     if (substr_count($objField->Name, "-")) {
         $tableName = $objTable ? " in table " . $objTable->Name : "";
         $this->strErrors .= "Invalid column name" . $tableName . ": " . $objField->Name . ". Dashes are not allowed.";
         return null;
     }
     $objColumn->DbType = $objField->Type;
     $objColumn->VariableType = $this->VariableTypeFromDbType($objColumn->DbType);
     $objColumn->VariableTypeAsConstant = QType::Constant($objColumn->VariableType);
     $objColumn->Length = $objField->MaxLength;
     $objColumn->Default = $objField->Default;
     $objColumn->PrimaryKey = $objField->PrimaryKey;
     $objColumn->NotNull = $objField->NotNull;
     $objColumn->Identity = $objField->Identity;
     $objColumn->Unique = $objField->Unique;
     if ($objField->PrimaryKey && $objTable && count($objTable->PrimaryKeyColumnArray) == 1) {
         $objColumn->Unique = true;
     }
     $objColumn->Timestamp = $objField->Timestamp;
     $objColumn->VariableName = $this->VariableNameFromColumn($objColumn);
     $objColumn->PropertyName = $this->PropertyNameFromColumn($objColumn);
     $objColumn->Comment = $objField->Comment;
     return $objColumn;
 }
开发者ID:tomVertuoz,项目名称:framework,代码行数:28,代码来源:QDatabaseCodeGen.class.php

示例2: AnalyzeTableColumn

 protected function AnalyzeTableColumn(QDatabaseFieldBase $objField, $objTable)
 {
     $objColumn = new QColumn();
     $objColumn->Name = $objField->Name;
     $objColumn->DbType = $objField->Type;
     $objColumn->VariableType = $this->VariableTypeFromDbType($objColumn->DbType);
     $objColumn->VariableTypeAsConstant = QType::Constant($objColumn->VariableType);
     $objColumn->Length = $objField->MaxLength;
     $objColumn->Default = $objField->Default;
     $objColumn->PrimaryKey = $objField->PrimaryKey;
     $objColumn->NotNull = $objField->NotNull;
     $objColumn->Identity = $objField->Identity;
     $objColumn->Unique = $objField->Unique;
     if ($objField->PrimaryKey && $objTable && count($objTable->PrimaryKeyColumnArray) == 1) {
         $objColumn->Unique = true;
     }
     $objColumn->Timestamp = $objField->Timestamp;
     $objColumn->VariableName = $this->VariableNameFromColumn($objColumn);
     $objColumn->PropertyName = $this->PropertyNameFromColumn($objColumn);
     return $objColumn;
 }
开发者ID:sarapsg,项目名称:prayuj,代码行数:21,代码来源:QDatabaseCodeGen.class.php

示例3: AnalyzeTableColumn

 protected function AnalyzeTableColumn(QDatabaseFieldBase $objField, $objTable)
 {
     $objColumn = new QSqlColumn();
     $objColumn->Name = $objField->Name;
     $objColumn->OwnerTable = $objTable;
     if (substr_count($objField->Name, "-")) {
         $tableName = $objTable ? " in table " . $objTable->Name : "";
         $this->strErrors .= "Invalid column name" . $tableName . ": " . $objField->Name . ". Dashes are not allowed.";
         return null;
     }
     $objColumn->DbType = $objField->Type;
     $objColumn->VariableType = $this->VariableTypeFromDbType($objColumn->DbType);
     $objColumn->VariableTypeAsConstant = QType::Constant($objColumn->VariableType);
     $objColumn->Length = $objField->MaxLength;
     $objColumn->Default = $objField->Default;
     $objColumn->PrimaryKey = $objField->PrimaryKey;
     $objColumn->NotNull = $objField->NotNull;
     $objColumn->Identity = $objField->Identity;
     $objColumn->Unique = $objField->Unique;
     if ($objField->PrimaryKey && $objTable && count($objTable->PrimaryKeyColumnArray) == 1) {
         $objColumn->Unique = true;
     }
     $objColumn->Timestamp = $objField->Timestamp;
     $objColumn->VariableName = $this->ModelColumnVariableName($objColumn);
     $objColumn->PropertyName = $this->ModelColumnPropertyName($objColumn->Name);
     // separate overrides embedded in the comment
     // extract options embedded in the comment field
     if (($strComment = $objField->Comment) && ($pos1 = strpos($strComment, '{')) !== false && ($pos2 = strrpos($strComment, '}', $pos1))) {
         $strJson = substr($strComment, $pos1, $pos2 - $pos1 + 1);
         $a = json_decode($strJson, true);
         if ($a) {
             $objColumn->Options = $a;
             $objColumn->Comment = substr($strComment, 0, $pos1) . substr($strComment, $pos2 + 1);
             // return comment without options
             if (!empty($a['Timestamp'])) {
                 $objColumn->Timestamp = true;
                 // alternate way to specify that a column is a self-updating timestamp
             }
             if ($objColumn->Timestamp && !empty($a['AutoUpdate'])) {
                 $objColumn->AutoUpdate = true;
             }
         } else {
             $objColumn->Comment = $strComment;
         }
     }
     // merge with options found in the design editor, letting editor take precedence
     $objColumn->Options = $this->objModelConnectorOptions->GetOptions($objTable->ClassName, $objColumn->PropertyName) + $objColumn->Options;
     return $objColumn;
 }
开发者ID:vaibhav-kaushal,项目名称:qc-framework,代码行数:49,代码来源:QDatabaseCodeGen.class.php


注:本文中的QType::Constant方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。