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


PHP SMWQueryResult::getErrors方法代码示例

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


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

示例1: assertQueryResultErrorCode

 private function assertQueryResultErrorCode($errorCode, QueryResult $queryResult)
 {
     if ($errorCode > 0) {
         return $this->assertNotEmpty($queryResult->getErrors());
     }
     $this->assertEmpty($queryResult->getErrors());
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:7,代码来源:QueryResultFactoryTest.php

示例2: getErrorString

 /**
  * Provides a simple formatted string of all the error messages that occurred.
  * Can be used if not specific error formatting is desired. Compatible with HTML
  * and Wiki.
  *
  * @param SMWQueryResult $res
  *
  * @return string
  */
 public function getErrorString(SMWQueryResult $res)
 {
     return $this->mShowErrors ? smwfEncodeMessages(array_merge($this->mErrors, $res->getErrors())) : '';
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:13,代码来源:SMW_QueryPrinter.php

示例3: assertThatQueryResultHasSubjects

 /**
  * @since 2.0
  *
  * @param  mixed $expected
  * @param  QueryResult $queryResult
  */
 public function assertThatQueryResultHasSubjects($expectedSubjects, QueryResult $queryResult)
 {
     $expectedSubjects = is_array($expectedSubjects) ? $expectedSubjects : array($expectedSubjects);
     $expectedToCount = count($expectedSubjects);
     $actualComparedToCount = 0;
     $this->assertEmpty($queryResult->getErrors());
     if ($expectedToCount == 0) {
         return;
     }
     $resultSubjects = $queryResult->getResults();
     foreach ($resultSubjects as $rKey => $resultSubject) {
         foreach ($expectedSubjects as $ekey => $expectedSubject) {
             if ($expectedSubject instanceof DIWikiPage && $expectedSubject->equals($resultSubject)) {
                 $actualComparedToCount++;
                 unset($expectedSubjects[$ekey]);
                 unset($resultSubjects[$rKey]);
             }
         }
     }
     $this->assertEquals($expectedToCount, $actualComparedToCount, 'Failed asserting that ' . implode(', ', $expectedSubjects) . ' is set.');
     $this->assertEmpty($resultSubjects, 'Failed to match results [ ' . implode(', ', $resultSubjects) . ' ] against the expected subjects.');
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:28,代码来源:QueryResultValidator.php


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