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


PHP Relationship::BuildQueryStatement方法代码示例

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


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

示例1: QueryCount

 /**
  * Static Qcodo Query method to query for a count of Relationship objects.
  * Uses BuildQueryStatment to perform most of the work.
  * @param QQCondition $objConditions any conditions on the query, itself
  * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
  * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
  * @return integer the count of queried objects as an integer
  */
 public static function QueryCount(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null)
 {
     // Get the Query Statement
     try {
         $strQuery = Relationship::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, true);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     // Perform the Query and return the row_count
     $objDbResult = $objQueryBuilder->Database->Query($strQuery);
     // Figure out if the query is using GroupBy
     $blnGrouped = false;
     if ($objOptionalClauses) {
         foreach ($objOptionalClauses as $objClause) {
             if ($objClause instanceof QQGroupBy) {
                 $blnGrouped = true;
                 break;
             }
         }
     }
     if ($blnGrouped) {
         // Groups in this query - return the count of Groups (which is the count of all rows)
         return $objDbResult->CountRows();
     } else {
         // No Groups - return the sql-calculated count(*) value
         $strDbRow = $objDbResult->FetchRow();
         return QType::Cast($strDbRow[0], QType::Integer);
     }
 }
开发者ID:alcf,项目名称:chms,代码行数:38,代码来源:RelationshipGen.class.php


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