本文整理匯總了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);
}