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


PHP SMWPropertyValue::isValid方法代码示例

本文整理汇总了PHP中SMWPropertyValue::isValid方法的典型用法代码示例。如果您正苦于以下问题:PHP SMWPropertyValue::isValid方法的具体用法?PHP SMWPropertyValue::isValid怎么用?PHP SMWPropertyValue::isValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SMWPropertyValue的用法示例。


在下文中一共展示了SMWPropertyValue::isValid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initialize

 /**
  * @since 2.1
  */
 public function initialize()
 {
     $params = explode('/', $this->queryString);
     reset($params);
     $escaped = false;
     // 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);
     // Auto-generated link is marked with a leading :
     if ($property !== '' && $property[0] === ':') {
         $escaped = true;
         $property = $this->urlEncoder->unescape(ltrim($property, ':'));
     }
     $this->property = PropertyValue::makeUserProperty(str_replace(array('_'), array(' '), $property));
     if (!$this->property->isValid()) {
         $this->propertyString = $property;
         $this->value = null;
         $this->valueString = $value;
     } else {
         $this->propertyString = $this->property->getDataItem()->getLabel();
         $this->valueString = $this->getValue((string) $value, $escaped);
     }
     $this->setLimit();
     $this->setOffset();
     $this->setNearbySearch();
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:30,代码来源: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: initPropertyChain

 private function initPropertyChain($value)
 {
     $chain = explode('.', $value);
     // Get the last which represents the final output
     // Foo.Bar.Foobar.Baz
     $last = array_pop($chain);
     $this->lastPropertyChainValue = PropertyValue::makeUserProperty($last);
     if (!$this->lastPropertyChainValue->isValid()) {
         return $this->addError($this->lastPropertyChainValue->getErrors());
     }
     $this->lastPropertyChainValue->setOptions($this->getOptions());
     // Generate a forward list from the remaining property labels
     // Foo.Bar.Foobar
     foreach ($chain as $value) {
         $propertyValue = PropertyValue::makeUserProperty($value);
         if (!$propertyValue->isValid()) {
             continue;
         }
         $propertyValue->setOptions($this->getOptions());
         $this->propertyValues[] = $propertyValue;
     }
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:22,代码来源:PropertyChainValue.php


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