本文整理汇总了PHP中SMWPropertyValue::getDataItem方法的典型用法代码示例。如果您正苦于以下问题:PHP SMWPropertyValue::getDataItem方法的具体用法?PHP SMWPropertyValue::getDataItem怎么用?PHP SMWPropertyValue::getDataItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMWPropertyValue
的用法示例。
在下文中一共展示了SMWPropertyValue::getDataItem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getValue
private function getValue($value, $escaped)
{
$this->value = DataValueFactory::getInstance()->newDataValueByProperty($this->property->getDataItem());
$value = $this->unescape($value, $escaped);
$this->value->setUserValue($value);
return $this->value->isValid() ? $this->value->getWikiValue() : $value;
}
示例2: initialize
/**
* @since 2.1
*/
public function initialize()
{
$params = explode('/', $this->queryString);
reset($params);
// Remove empty elements
$params = array_filter($params, 'strlen');
$property = isset($this->requestOptions['property']) ? $this->requestOptions['property'] : current($params);
$value = isset($this->requestOptions['value']) ? $this->requestOptions['value'] : next($params);
$property = $this->urlEncoder->decode($property);
$value = str_replace(array('-25'), array('%'), $value);
$this->property = PropertyValue::makeUserProperty($property);
if (!$this->property->isValid()) {
$this->propertyString = $property;
$this->value = null;
$this->valueString = $value;
} else {
$this->propertyString = $this->property->getWikiValue();
$this->value = DataValueFactory::getInstance()->newPropertyObjectValue($this->property->getDataItem(), $this->urlEncoder->decode($value));
$this->valueString = $this->value->isValid() ? $this->value->getWikiValue() : $value;
}
$this->setLimit();
$this->setOffset();
$this->setNearbySearch();
}
示例3: isVisible
/**
* @see PropertyValue::isVisible
*/
public function isVisible()
{
return $this->isValid() && ($this->lastPropertyChainValue->getDataItem()->isUserDefined() || $this->lastPropertyChainValue->getDataItem()->getLabel() !== '');
}
示例4: getPropertyLabel
/**
* Figures out the label of the property to be used. For outgoing ones it is just
* the text, for incoming ones we try to figure out the inverse one if needed,
* either by looking for an explicitly stated one or by creating a default one.
*
* @param[in] $property SMWPropertyValue The property of interest
* @param[in] $incoming bool If it is an incoming property
*
* @return string The label of the property
*/
private function getPropertyLabel(\SMWPropertyValue $property, $incoming = false)
{
if ($incoming && $this->getOption('showInverse')) {
$oppositeprop = \SMWPropertyValue::makeUserProperty(wfMessage('smw_inverse_label_property')->text());
$labelarray = $this->store->getPropertyValues($property->getDataItem()->getDiWikiPage(), $oppositeprop->getDataItem());
$rv = count($labelarray) > 0 ? $labelarray[0]->getLongWikiText() : wfMessage('smw_inverse_label_default', $property->getWikiValue())->text();
} else {
$rv = $property->getWikiValue();
}
return $this->unbreak($rv);
}
示例5: getPropertyLabel
/**
* Figures out the label of the property to be used. For outgoing ones it is just
* the text, for incoming ones we try to figure out the inverse one if needed,
* either by looking for an explicitly stated one or by creating a default one.
*
* @param[in] $property SMWPropertyValue The property of interest
* @param[in] $incoming bool If it is an incoming property
*
* @return string The label of the property
*/
private function getPropertyLabel( SMWPropertyValue $property, $incoming = false ) {
global $smwgBrowseShowInverse;
if ( $incoming && $smwgBrowseShowInverse ) {
$oppositeprop = SMWPropertyValue::makeUserProperty( wfMsg( 'smw_inverse_label_property' ) );
$labelarray = &smwfGetStore()->getPropertyValues( $property->getDataItem()->getDiWikiPage(), $oppositeprop->getDataItem() );
$rv = ( count( $labelarray ) > 0 ) ? $labelarray[0]->getLongWikiText():
wfMsg( 'smw_inverse_label_default', $property->getWikiValue() );
} else {
$rv = $property->getWikiValue();
}
return $this->unbreak( $rv );
}