本文整理汇总了PHP中SMW\DIWikiPage::getDataItem方法的典型用法代码示例。如果您正苦于以下问题:PHP DIWikiPage::getDataItem方法的具体用法?PHP DIWikiPage::getDataItem怎么用?PHP DIWikiPage::getDataItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMW\DIWikiPage
的用法示例。
在下文中一共展示了DIWikiPage::getDataItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInData
/**
* Creates a Semantic Data object with the incoming properties instead of the
* usual outproperties.
*
* @return array(SMWSemanticData, bool) The semantic data including all inproperties, and if there are more inproperties left
*/
private function getInData()
{
$indata = new SemanticData($this->subject->getDataItem());
$propRequestOptions = new RequestOptions();
$propRequestOptions->sort = true;
$propRequestOptions->limit = $this->incomingPropertiesCount;
if ($this->offset > 0) {
$propRequestOptions->offset = $this->offset;
}
$incomingProperties = $this->store->getInProperties($this->subject->getDataItem(), $propRequestOptions);
$more = false;
if (count($incomingProperties) == $this->incomingPropertiesCount) {
$more = true;
array_pop($incomingProperties);
// drop the last one
}
$valRequestOptions = new RequestOptions();
$valRequestOptions->sort = true;
$valRequestOptions->limit = $this->incomingValuesCount;
foreach ($incomingProperties as $property) {
$values = $this->store->getPropertySubjects($property, $this->subject->getDataItem(), $valRequestOptions);
foreach ($values as $value) {
$indata->addPropertyObjectValue($property, $value);
}
}
// Added in 2.3
// Whether to show a more link or not can be set via
// SMW::Browse::BeforeIncomingPropertyValuesFurtherLinkCreate
\Hooks::run('SMW::Browse::AfterIncomingPropertiesLookupComplete', array($this->store, $indata, $valRequestOptions));
return array($indata, $more);
}