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


PHP SMWQuery::getQuerySource方法代码示例

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


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

示例1: get

 /**
  * @since 2.5
  *
  * @param Query $query
  *
  * @return string
  */
 public static function get(Query $query)
 {
     $serialized = array();
     $serialized['conditions'] = $query->getQueryString();
     $serialized['parameters'] = array('limit=' . $query->getLimit(), 'offset=' . $query->getOffset(), 'mainlabel=' . $query->getMainlabel());
     if ($query->getQuerySource() !== null && $query->getQuerySource() !== '') {
         $serialized['parameters'] = array_merge($serialized['parameters'], array('source=' . $query->getQuerySource()));
     }
     list($serialized['sort'], $serialized['order']) = self::doSerializeSortKeys($query);
     $serialized['printouts'] = self::doSerializePrintouts($query);
     $encoded = $serialized['conditions'] . '|' . ($serialized['printouts'] !== array() ? implode('|', $serialized['printouts']) . '|' : '') . implode('|', $serialized['parameters']) . ($serialized['sort'] !== array() ? '|sort=' . implode(',', $serialized['sort']) : '') . ($serialized['order'] !== array() ? '|order=' . implode(',', $serialized['order']) : '');
     return $encoded;
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:20,代码来源:QueryStringifier.php

示例2: toArray

 /**
  * Returns a serialized SMWQueryResult object with additional meta data
  *
  * This methods extends the serializeToArray() for additional meta
  * that are useful when handling data via the api
  *
  * @note should be used instead of SMWQueryResult::serializeToArray()
  * as this method contains additional informaion
  *
  * @since 1.9
  *
  * @return array
  */
 public function toArray()
 {
     // @note micro optimization: We call getSerializedQueryResult()
     // only once and create the hash here instead of calling getHash()
     // to avoid getSerializedQueryResult() being called again
     // @note count + offset equals total therefore we deploy both values
     $serializeArray = $this->serializeToArray();
     return array_merge($serializeArray, array('meta' => array('hash' => HashBuilder::createHashIdForContent($serializeArray), 'count' => $this->getCount(), 'offset' => $this->mQuery->getOffset(), 'source' => $this->mQuery->getQuerySource())));
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:22,代码来源:SMW_QueryResult.php


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