当前位置: 首页>>代码示例>>PHP>>正文


PHP SMWPropertyValue::getDataItem方法代码示例

本文整理汇总了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;
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:7,代码来源:PageRequestOptions.php

示例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();
 }
开发者ID:WolfgangFahl,项目名称:SemanticMediaWiki,代码行数:27,代码来源:PageRequestOptions.php

示例3: isVisible

 /**
  * @see PropertyValue::isVisible
  */
 public function isVisible()
 {
     return $this->isValid() && ($this->lastPropertyChainValue->getDataItem()->isUserDefined() || $this->lastPropertyChainValue->getDataItem()->getLabel() !== '');
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:7,代码来源:PropertyChainValue.php

示例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);
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:21,代码来源:HtmlContentBuilder.php

示例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 );
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:24,代码来源:SMW_SpecialBrowse.php


注:本文中的SMWPropertyValue::getDataItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。