• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP QConvertNotation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __set

 public function __set($strName, $mixValue)
 {
     // These are included here because this class is constructed before code generation
     // include_once(__INCLUDES__ . '/qcodo/_core/codegen/QConvertNotationBase.class.php');
     include_once __INCLUDES__ . '/qcodo/codegen/QConvertNotation.class.php';
     switch ($strName) {
         ///////////////////
         // Member Variables
         ///////////////////
         default:
             try {
                 $objAdminSetting = AdminSetting::LoadByShortDescription(QConvertNotation::UnderscoreFromCamelCase($strName));
                 $objAdminSetting->Value = $mixValue;
                 return $objAdminSetting->Save();
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
开发者ID:heshuai64,项目名称:einv2,代码行数:20,代码来源:TracmorSettings.class.php


示例2: MetaAddTypeColumn

 /**
  * Similar to MetaAddColumn, except it creates a column for a Type-based Id.  You MUST specify
  * the name of the Type class that this will attempt to use $NameArray against.
  * 
  * Also, $mixContent cannot be an array.  Only a single field can be specified.
  *
  * @param mixed $mixContent string or QQNode from Country
  * @param string $strTypeClassName the name of the TypeClass to use $NameArray against
  * @param mixed $objOverrideParameters
  */
 public function MetaAddTypeColumn($mixContent, $strTypeClassName, $objOverrideParameters = null)
 {
     // Validate TypeClassName
     if (!class_exists($strTypeClassName) || !property_exists($strTypeClassName, 'NameArray')) {
         throw new QCallerException('Invalid TypeClass Name: ' . $strTypeClassName);
     }
     // Validate Node
     try {
         $objNode = $this->ResolveContentItem($mixContent);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     // Create the Column
     $strName = QConvertNotation::WordsFromCamelCase($objNode->_PropertyName);
     if (strtolower(substr($strName, strlen($strName) - 3)) == ' id') {
         $strName = substr($strName, 0, strlen($strName) - 3);
     }
     $strProperty = $objNode->GetDataGridHtml();
     $objNewColumn = new QDataGridColumn(QApplication::Translate($strName), sprintf('<?=(%s) ? %s::$NameArray[%s] : null;?>', $strProperty, $strTypeClassName, $strProperty), array('OrderByClause' => QQ::OrderBy($objNode), 'ReverseOrderByClause' => QQ::OrderBy($objNode, false)));
     // Perform Overrides
     $objOverrideArray = func_get_args();
     if (count($objOverrideArray) > 2) {
         try {
             unset($objOverrideArray[0]);
             unset($objOverrideArray[1]);
             $objNewColumn->OverrideAttributes($objOverrideArray);
         } catch (QCallerException $objExc) {
             $objExc->IncrementOffset();
             throw $objExc;
         }
     }
     $this->AddColumn($objNewColumn);
     return $objNewColumn;
 }
开发者ID:qcodo,项目名称:qcodo-website,代码行数:45,代码来源:CountryDataGridGen.class.php


示例3: AnalyzeTable


//.........这里部分代码省略.........
                             $objReference->IsType = true;
                         } else {
                             $objReference->IsType = false;
                         }
                         // Setup Table and Column names
                         $objReference->Table = $strReferencedTableName;
                         $objReference->Column = $objForeignKey->ReferenceColumnNameArray[0];
                         // Setup VariableType
                         $objReference->VariableType = $this->ClassNameFromTableName($strReferencedTableName);
                         // Setup PropertyName and VariableName
                         $objReference->PropertyName = $this->ReferencePropertyNameFromColumn($objColumn);
                         $objReference->VariableName = $this->ReferenceVariableNameFromColumn($objColumn);
                         // Add this reference to the column
                         $objColumn->Reference = $objReference;
                         // STEP 2: Setup the REVERSE Reference for Non Type-based References
                         if (!$objReference->IsType) {
                             // Retrieve the ReferencedTable object
                             //								$objReferencedTable = $this->objTableArray[strtolower($objReference->Table)];
                             $objReferencedTable = $this->GetTable($objReference->Table);
                             $objReverseReference = new QReverseReference();
                             $objReverseReference->KeyName = $objReference->KeyName;
                             $objReverseReference->Table = $strTableName;
                             $objReverseReference->Column = $strColumnName;
                             $objReverseReference->NotNull = $objColumn->NotNull;
                             $objReverseReference->Unique = $objColumn->Unique;
                             $objReverseReference->PropertyName = $this->PropertyNameFromColumn($this->GetColumn($strTableName, $strColumnName));
                             $objReverseReference->ObjectDescription = $this->CalculateObjectDescription($strTableName, $strColumnName, $strReferencedTableName, false);
                             $objReverseReference->ObjectDescriptionPlural = $this->CalculateObjectDescription($strTableName, $strColumnName, $strReferencedTableName, true);
                             $objReverseReference->VariableName = $this->ReverseReferenceVariableNameFromTable($objTable->Name);
                             $objReverseReference->VariableType = $this->ReverseReferenceVariableTypeFromTable($objTable->Name);
                             // For Special Case ReverseReferences, calculate Associated MemberVariableName and PropertyName...
                             // See if ReverseReference is due to an ORM-based Class Inheritence Chain
                             if (count($objTable->PrimaryKeyColumnArray) == 1 && $objColumn->PrimaryKey) {
                                 $objReverseReference->ObjectMemberVariable = QConvertNotation::PrefixFromType(QType::Object) . $objReverseReference->VariableType;
                                 $objReverseReference->ObjectPropertyName = $objReverseReference->VariableType;
                                 $objReverseReference->ObjectDescription = $objReverseReference->VariableType;
                                 $objReverseReference->ObjectDescriptionPlural = $this->Pluralize($objReverseReference->VariableType);
                                 // Otherwise, see if it's just plain ol' unique
                             } else {
                                 if ($objColumn->Unique) {
                                     $objReverseReference->ObjectMemberVariable = $this->CalculateObjectMemberVariable($strTableName, $strColumnName, $strReferencedTableName);
                                     $objReverseReference->ObjectPropertyName = $this->CalculateObjectPropertyName($strTableName, $strColumnName, $strReferencedTableName);
                                 }
                             }
                             // Add this ReverseReference to the referenced table's ReverseReferenceArray
                             $objArray = $objReferencedTable->ReverseReferenceArray;
                             array_push($objArray, $objReverseReference);
                             $objReferencedTable->ReverseReferenceArray = $objArray;
                         }
                     } else {
                         $this->strErrors .= sprintf("Foreign Key %s in table %s references a table %s that does not appear to exist.\n", $objForeignKey->KeyName, $strTableName, $objForeignKey->ReferenceTableName);
                     }
                 } else {
                     $this->strErrors .= sprintf("Foreign Key %s in table %s indexes on a column that does not appear to exist.\n", $objForeignKey->KeyName, $strTableName);
                 }
             }
         }
     }
     // Verify: Table Name is valid (alphanumeric + "_" characters only, must not start with a number)
     // and NOT a PHP Reserved Word
     $strMatches = array();
     preg_match('/' . $this->strPatternTableName . '/', $strTableName, $strMatches);
     if (count($strMatches) && $strMatches[0] == $strTableName && $strTableName != '_') {
         // Setup Reserved Words
         $strReservedWords = explode(',', QCodeGen::PhpReservedWords);
         for ($intIndex = 0; $intIndex < count($strReservedWords); $intIndex++) {
开发者ID:sarapsg,项目名称:prayuj,代码行数:67,代码来源:QDatabaseCodeGen.class.php


示例4: CalculateObjectDescriptionForAssociation

 protected function CalculateObjectDescriptionForAssociation($strAssociationTableName, $strTableName, $strReferencedTableName, $blnPluralize)
 {
     // Strip Prefixes (if applicable)
     $strTableName = $this->StripPrefixFromTable($strTableName);
     $strAssociationTableName = $this->StripPrefixFromTable($strAssociationTableName);
     $strReferencedTableName = $this->StripPrefixFromTable($strReferencedTableName);
     // Starting Point
     $strToReturn = QConvertNotation::CamelCaseFromUnderscore($strReferencedTableName);
     if ($blnPluralize) {
         $strToReturn = $this->Pluralize($strToReturn);
     }
     // Let's start with strAssociationTableName
     // Rip out trailing "_assn" if applicable
     $strAssociationTableName = str_replace($this->strAssociationTableSuffix, '', $strAssociationTableName);
     // Take out strTableName if applicable (both with and without underscores)
     $strAssociationTableName = str_replace($strTableName, '', $strAssociationTableName);
     $strTableName = str_replace('_', '', $strTableName);
     $strAssociationTableName = str_replace($strTableName, '', $strAssociationTableName);
     // Take out strReferencedTableName if applicable (both with and without underscores)
     $strAssociationTableName = str_replace($strReferencedTableName, '', $strAssociationTableName);
     $strReferencedTableName = str_replace('_', '', $strReferencedTableName);
     $strAssociationTableName = str_replace($strReferencedTableName, '', $strAssociationTableName);
     // Change any double "__" to single "_"
     $strAssociationTableName = str_replace("__", "_", $strAssociationTableName);
     $strAssociationTableName = str_replace("__", "_", $strAssociationTableName);
     $strAssociationTableName = str_replace("__", "_", $strAssociationTableName);
     // If we have nothing left or just a single "_" in AssociationTableName, return "Starting Point"
     if ($strAssociationTableName == "_" || $strAssociationTableName == "") {
         return sprintf("%s%s%s", $this->strAssociatedObjectPrefix, $strToReturn, $this->strAssociatedObjectSuffix);
     }
     // Otherwise, add "As" and the predicate
     return sprintf("%s%sAs%s%s", $this->strAssociatedObjectPrefix, $strToReturn, QConvertNotation::CamelCaseFromUnderscore($strAssociationTableName), $this->strAssociatedObjectSuffix);
 }
开发者ID:kmcelhinney,项目名称:qcodo,代码行数:33,代码来源:QCodeGenBase.class.php


示例5: btnDelete_Click

		}

		protected function btnDelete_Click($strFormId, $strControlId, $strParameter) {
			// Delegate "Delete" processing to the <?php 
echo $objTable->ClassName;
?>
MetaControl
			$this->mct<?php 
echo $objTable->ClassName;
?>
->Delete<?php 
echo $objTable->ClassName;
?>
();
			$this->RedirectToListPage();
		}

		protected function btnCancel_Click($strFormId, $strControlId, $strParameter) {
			$this->RedirectToListPage();
		}

		// Other Methods

		protected function RedirectToListPage() {
			QApplication::Redirect(__VIRTUAL_DIRECTORY__ . __FORM_DRAFTS__ . '/<?php 
echo QConvertNotation::UnderscoreFromCamelCase($objTable->ClassName);
?>
_list.php');
		}
	}
?>
开发者ID:tomVertuoz,项目名称:framework,代码行数:31,代码来源:_qform_edit_base.tpl.php


示例6: JavaCaseFromUnderscore

 public static function JavaCaseFromUnderscore($strName)
 {
     $strToReturn = QConvertNotation::CamelCaseFromUnderscore($strName);
     return strtolower(substr($strToReturn, 0, 1)) . substr($strToReturn, 1);
 }
开发者ID:eliud254,项目名称:q-auction,代码行数:5,代码来源:QConvertNotationBase.class.php


示例7: _Create

		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function <?php 
echo $strLabelId;
?>
_Create($strControlId = null) {
			$this-><?php 
echo $strLabelId;
?>
 = new QLabel($this->objParentObject, $strControlId);
			$this-><?php 
echo $strLabelId;
?>
->Name = QApplication::Translate('<?php 
echo QConvertNotation::WordsFromCamelCase($objReverseReference->ObjectPropertyName);
?>
');
			$this-><?php 
echo $strLabelId;
?>
->Text = ($this-><?php 
echo $strObjectName;
?>
-><?php 
echo $objReverseReference->ObjectPropertyName;
?>
) ? $this-><?php 
echo $strObjectName;
?>
-><?php 
开发者ID:tomVertuoz,项目名称:framework,代码行数:31,代码来源:control_create_unique_reversereference.tpl.php


示例8: _Create

		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function <?php 
echo $strLabelId;
?>
_Create($strControlId = null) {
			$this-><?php 
echo $strLabelId;
?>
 = new QLabel($this->objParentObject, $strControlId);
			$this-><?php 
echo $strLabelId;
?>
->Name = QApplication::Translate('<?php 
echo QConvertNotation::WordsFromCamelCase($objManyToManyReference->ObjectDescriptionPlural);
?>
');
			
			$aSelection = $this-><?php 
echo $strObjectName;
?>
->Get<?php 
echo $objManyToManyReference->ObjectDescription;
?>
Array();
			$this-><?php 
echo $strLabelId;
?>
->Text = implode($this->str<?php 
echo $objManyToManyReference->ObjectDescription;
开发者ID:tomVertuoz,项目名称:framework,代码行数:31,代码来源:control_create_manytomany_type.tpl.php


示例9: CalculateObjectDescriptionForAssociation

 protected function CalculateObjectDescriptionForAssociation($strAssociationTableName, $strTableName, $strReferencedTableName, $blnPluralize)
 {
     // Strip Prefixes (if applicable)
     $strTableName = $this->StripPrefixFromTable($strTableName);
     $strAssociationTableName = $this->StripPrefixFromTable($strAssociationTableName);
     $strReferencedTableName = $this->StripPrefixFromTable($strReferencedTableName);
     // Starting Point
     $strToReturn = QConvertNotation::CamelCaseFromUnderscore($strReferencedTableName);
     if ($blnPluralize) {
         $strToReturn = $this->Pluralize($strToReturn);
     }
     // Let's start with strAssociationTableName
     // Rip out trailing "_assn" if applicable
     $strAssociationTableName = str_replace($this->strAssociationTableSuffix, '', $strAssociationTableName);
     // remove instances of the table names in the association table name
     $strTableName2 = str_replace('_', '', $strTableName);
     // remove underscores if they are there
     $strReferencedTableName2 = str_replace('_', '', $strReferencedTableName);
     // remove underscores if they are there
     if (beginsWith($strAssociationTableName, $strTableName . '_')) {
         $strAssociationTableName = trimOffFront($strTableName . '_', $strAssociationTableName);
     } elseif (beginsWith($strAssociationTableName, $strTableName2 . '_')) {
         $strAssociationTableName = trimOffFront($strTableName2 . '_', $strAssociationTableName);
     } elseif (beginsWith($strAssociationTableName, $strReferencedTableName . '_')) {
         $strAssociationTableName = trimOffFront($strReferencedTableName . '_', $strAssociationTableName);
     } elseif (beginsWith($strAssociationTableName, $strReferencedTableName2 . '_')) {
         $strAssociationTableName = trimOffFront($strReferencedTableName2 . '_', $strAssociationTableName);
     } elseif ($strAssociationTableName == $strTableName || $strAssociationTableName == $strTableName2 || $strAssociationTableName == $strReferencedTableName || $strAssociationTableName == $strReferencedTableName2) {
         $strAssociationTableName = "";
     }
     if (endsWith($strAssociationTableName, '_' . $strTableName)) {
         $strAssociationTableName = trimOffEnd('_' . $strTableName, $strAssociationTableName);
     } elseif (endsWith($strAssociationTableName, '_' . $strTableName2)) {
         $strAssociationTableName = trimOffEnd('_' . $strTableName2, $strAssociationTableName);
     } elseif (endsWith($strAssociationTableName, '_' . $strReferencedTableName)) {
         $strAssociationTableName = trimOffEnd('_' . $strReferencedTableName, $strAssociationTableName);
     } elseif (endsWith($strAssociationTableName, '_' . $strReferencedTableName2)) {
         $strAssociationTableName = trimOffEnd('_' . $strReferencedTableName2, $strAssociationTableName);
     } elseif ($strAssociationTableName == $strTableName || $strAssociationTableName == $strTableName2 || $strAssociationTableName == $strReferencedTableName || $strAssociationTableName == $strReferencedTableName2) {
         $strAssociationTableName = "";
     }
     // Change any double "__" to single "_"
     $strAssociationTableName = str_replace("__", "_", $strAssociationTableName);
     $strAssociationTableName = str_replace("__", "_", $strAssociationTableName);
     $strAssociationTableName = str_replace("__", "_", $strAssociationTableName);
     // If we have nothing left or just a single "_" in AssociationTableName, return "Starting Point"
     if ($strAssociationTableName == "_" || $strAssociationTableName == "") {
         return sprintf("%s%s%s", $this->strAssociatedObjectPrefix, $strToReturn, $this->strAssociatedObjectSuffix);
     }
     // Otherwise, add "As" and the predicate
     return sprintf("%s%sAs%s%s", $this->strAssociatedObjectPrefix, $strToReturn, QConvertNotation::CamelCaseFromUnderscore($strAssociationTableName), $this->strAssociatedObjectSuffix);
 }
开发者ID:vaibhav-kaushal,项目名称:qc-framework,代码行数:52,代码来源:QCodeGenBase.class.php


示例10:

	}

//	protected function Form_Load() {}

<?php 
include 'edit_form_create.tpl.php';
?>

<?php 
include 'edit_create_buttons.tpl.php';
?>

<?php 
include 'edit_button_click.tpl.php';
?>

}

// Go ahead and run this form object to render the page and its event handlers, implicitly using
// <?php 
echo QConvertNotation::UnderscoreFromCamelCase($strPropertyName);
?>
_edit.tpl.php as the included HTML template file
<?php 
echo $strPropertyName;
?>
EditForm::Run('<?php 
echo $strPropertyName;
?>
EditForm');
开发者ID:vaibhav-kaushal,项目名称:qc-framework,代码行数:30,代码来源:_qform_edit.tpl.php


示例11: _Create

		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function <?php 
echo $strLabelId;
?>
_Create($strControlId = null) {
			$this-><?php 
echo $strLabelId;
?>
 = new QLabel($this->objParentObject, $strControlId);
			$this-><?php 
echo $strLabelId;
?>
->Name = QApplication::Translate('<?php 
echo QConvertNotation::WordsFromCamelCase($objColumn->Reference->PropertyName);
?>
');
			$this-><?php 
echo $strLabelId;
?>
->Text = ($this-><?php 
echo $strObjectName;
?>
-><?php 
echo $objColumn->Reference->PropertyName;
?>
) ? $this-><?php 
echo $strObjectName;
?>
-><?php 
开发者ID:tomVertuoz,项目名称:framework,代码行数:31,代码来源:control_create_reference.tpl.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP QDataGrid类代码示例发布时间:2022-05-23
下一篇:
PHP QControl类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap