本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}