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


PHP AttributeValue::GetSelectFields方法代码示例

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


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

示例1: BuildQueryStatement

 /**
  * Internally called method to assist with calling Qcodo Query for this class
  * on load methods.
  * @param QQueryBuilder &$objQueryBuilder the QueryBuilder object that will be created
  * @param QQCondition $objConditions any conditions on the query, itself
  * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for this query
  * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with (sending in null will skip the PrepareStatement step)
  * @param boolean $blnCountOnly only select a rowcount
  * @return string the query statement
  */
 protected static function BuildQueryStatement(&$objQueryBuilder, QQCondition $objConditions, $objOptionalClauses, $mixParameterArray, $blnCountOnly)
 {
     // Get the Database Object for this Class
     $objDatabase = AttributeValue::GetDatabase();
     // Create/Build out the QueryBuilder object with AttributeValue-specific SELET and FROM fields
     $objQueryBuilder = new QQueryBuilder($objDatabase, 'attribute_value');
     AttributeValue::GetSelectFields($objQueryBuilder);
     $objQueryBuilder->AddFromItem('attribute_value');
     // Set "CountOnly" option (if applicable)
     if ($blnCountOnly) {
         $objQueryBuilder->SetCountOnlyFlag();
     }
     // Apply Any Conditions
     if ($objConditions) {
         try {
             $objConditions->UpdateQueryBuilder($objQueryBuilder);
         } catch (QCallerException $objExc) {
             $objExc->IncrementOffset();
             throw $objExc;
         }
     }
     // Iterate through all the Optional Clauses (if any) and perform accordingly
     if ($objOptionalClauses) {
         if ($objOptionalClauses instanceof QQClause) {
             $objOptionalClauses->UpdateQueryBuilder($objQueryBuilder);
         } else {
             if (is_array($objOptionalClauses)) {
                 foreach ($objOptionalClauses as $objClause) {
                     $objClause->UpdateQueryBuilder($objQueryBuilder);
                 }
             } else {
                 throw new QCallerException('Optional Clauses must be a QQClause object or an array of QQClause objects');
             }
         }
     }
     // Get the SQL Statement
     $strQuery = $objQueryBuilder->GetStatement();
     // Prepare the Statement with the Query Parameters (if applicable)
     if ($mixParameterArray) {
         if (is_array($mixParameterArray)) {
             if (count($mixParameterArray)) {
                 $strQuery = $objDatabase->PrepareStatement($strQuery, $mixParameterArray);
             }
             // Ensure that there are no other Unresolved Named Parameters
             if (strpos($strQuery, chr(QQNamedValue::DelimiterCode) . '{') !== false) {
                 throw new QCallerException('Unresolved named parameters in the query');
             }
         } else {
             throw new QCallerException('Parameter Array must be an array of name-value parameter pairs');
         }
     }
     // Return the Objects
     return $strQuery;
 }
开发者ID:alcf,项目名称:chms,代码行数:64,代码来源:AttributeValueGen.class.php


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