當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。