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


PHP DIWikiPage::doUnserialize方法代码示例

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


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

示例1: testAddPropertyValue

 public function testAddPropertyValue()
 {
     $instance = new SemanticData(DIWikiPage::newFromTitle(Title::newFromText(__METHOD__)));
     $instance->addPropertyValue('addPropertyValue', DIWikiPage::doUnserialize('Foo#0#'));
     $key = Localizer::getInstance()->getNamespaceTextById(SMW_NS_PROPERTY) . ':' . 'addPropertyValue';
     $expected = array('propertyCount' => 1, 'propertyLabels' => array($key), 'propertyValues' => array('Foo'));
     $this->semanticDataValidator->assertThatPropertiesAreSet($expected, $instance);
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:8,代码来源:SemanticDataTest.php

示例2: deserialize

 /**
  * @see Deserializers::deserialize
  *
  * @since 1.9
  *
  * @return SemanticData
  * @throws OutOfBoundsException
  */
 public function deserialize($data)
 {
     $semanticData = null;
     if (isset($data['version']) && $data['version'] !== 0.1) {
         throw new OutOfBoundsException('Serializer/Unserializer version do not match, please update your data');
     }
     if (isset($data['subject'])) {
         $semanticData = new SemanticData(DIWikiPage::doUnserialize($data['subject']));
     }
     if (!$this->isDeserializerFor($semanticData)) {
         throw new OutOfBoundsException('SemanticData could not be created probably due to a missing subject');
     }
     $this->unserializeSemanticData($data, $semanticData);
     return $semanticData;
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:23,代码来源:SemanticDataDeserializer.php

示例3: getExpectedSubjects

 /**
  * @since 2.2
  *
  * @return DIWikiPage[]
  */
 public function getExpectedSubjects()
 {
     $subjects = array();
     if (!isset($this->contents['queryresult']['results'])) {
         return $subjects;
     }
     foreach ($this->contents['queryresult']['results'] as $hashName) {
         $subjects[] = DIWikiPage::doUnserialize(str_replace(' ', '_', $hashName));
     }
     return $subjects;
 }
开发者ID:hangya,项目名称:SemanticMediaWiki,代码行数:16,代码来源:QueryTestCaseInterpreter.php

示例4: createUpdateJobsFromListBySecondaryRun

 private function createUpdateJobsFromListBySecondaryRun(array $listOfSubjects)
 {
     $subjects = array_keys($listOfSubjects);
     // We are confident that as this point we only have valid, non-duplicate
     // subjects in the list and therefore can be deserialized without any
     // extra validation
     foreach ($subjects as $subject) {
         $this->jobs[] = new UpdateJob(DIWikiPage::doUnserialize($subject)->getTitle());
     }
     $this->pushToJobQueue();
     return true;
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:12,代码来源:UpdateDispatcherJob.php

示例5: newQueryResultFromCache

 private function newQueryResultFromCache($queryId, $query, $container)
 {
     $results = array();
     $this->transientStatsdCollector->incr($query->getContextPage() !== null ? 'hits.embedded' : 'hits.nonEmbedded');
     $this->transientStatsdCollector->calcMedian('medianRetrievalResponseTime.cached', round(microtime(true) - $this->start, 5));
     foreach ($container->get('results') as $hash) {
         $results[] = DIWikiPage::doUnserialize($hash);
     }
     $queryResult = $this->queryFactory->newQueryResult($this->store, $query, $results, $container->get('continue'));
     $queryResult->setCountValue($container->get('count'));
     $queryResult->setFromCache(true);
     $time = round(microtime(true) - $this->start, 5);
     $this->log(__METHOD__ . ' (sec): ' . $time . " ({$queryId})");
     return $queryResult;
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:15,代码来源:CachedQueryResultPrefetcher.php


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