當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。