當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DataValueFactory::newPropertyValue方法代碼示例

本文整理匯總了PHP中SMW\DataValueFactory::newPropertyValue方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataValueFactory::newPropertyValue方法的具體用法?PHP DataValueFactory::newPropertyValue怎麽用?PHP DataValueFactory::newPropertyValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SMW\DataValueFactory的用法示例。


在下文中一共展示了DataValueFactory::newPropertyValue方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: addDataValuesToSubobject

 protected function addDataValuesToSubobject(ParserParameterProcessor $parameters)
 {
     $subject = $this->parserData->getSemanticData()->getSubject();
     // Named subobjects containing a "." in the first five characters are reserved to be
     // used by extensions only in order to separate them from user land and avoid them
     // accidentally to refer to the same named ID
     // (i.e. different access restrictions etc.)
     if (strpos(mb_substr($parameters->getFirst(), 0, 5), '.') !== false) {
         return $this->addErrorWithMsg($subject, wfMessage('smw-subobject-parser-invalid-naming-scheme', $parameters->getFirst())->escaped());
     }
     $this->subobject->setEmptyContainerForId($this->createSubobjectId($parameters));
     foreach ($this->transformParametersToArray($parameters) as $property => $values) {
         if ($property === self::PARAM_SORTKEY) {
             $property = DIProperty::TYPE_SORTKEY;
         }
         if ($property === self::PARAM_CATEGORY) {
             $property = DIProperty::TYPE_CATEGORY;
         }
         foreach ($values as $value) {
             $dataValue = $this->dataValueFactory->newPropertyValue($property, $value, false, $subject);
             $this->subobject->addDataValue($dataValue);
         }
     }
     return true;
 }
開發者ID:WolfgangFahl,項目名稱:SemanticMediaWiki,代碼行數:25,代碼來源:SubobjectParserFunction.php

示例2: addDataValuesToSubobject

 protected function addDataValuesToSubobject(ArrayFormatter $parameters)
 {
     $subject = $this->parserData->getSemanticData()->getSubject();
     $this->subobject->setEmptyContainerForId($this->createSubobjectId($parameters));
     foreach ($this->transformParametersToArray($parameters) as $property => $values) {
         if ($property === self::PARAM_SORTKEY) {
             $property = DIProperty::TYPE_SORTKEY;
         }
         foreach ($values as $value) {
             $dataValue = $this->dataValueFactory->newPropertyValue($property, $value, false, $subject);
             $this->subobject->addDataValue($dataValue);
         }
     }
 }
開發者ID:whysasse,項目名稱:kmwiki,代碼行數:14,代碼來源:SubobjectParserFunction.php

示例3: addPropertyValue

 /**
  * Adds property values to the ParserOutput instance
  *
  * @since 1.9
  *
  * @param array $properties
  *
  * @return string
  */
 protected function addPropertyValue(array $properties, $value, $valueCaption)
 {
     $subject = $this->parserData->getSemanticData()->getSubject();
     // Add properties to the semantic container
     foreach ($properties as $property) {
         $dataValue = $this->dataValueFactory->newPropertyValue($property, $value, $valueCaption, $subject);
         if ($this->isEnabledNamespace && $this->isAnnotation) {
             $this->parserData->addDataValue($dataValue);
         }
     }
     // Return the text representation
     $result = $dataValue->getShortWikitext(true);
     // If necessary add an error text
     if ($this->settings->get('smwgInlineErrors') && $this->isEnabledNamespace && $this->isAnnotation && !$dataValue->isValid()) {
         $result .= $dataValue->getErrorText();
     }
     return $result;
 }
開發者ID:whysasse,項目名稱:kmwiki,代碼行數:27,代碼來源:InTextAnnotationParser.php

示例4: addPropertyValue

 /**
  * Adds property values to the ParserOutput instance
  *
  * @since 1.9
  *
  * @param array $properties
  *
  * @return string
  */
 protected function addPropertyValue(array $properties, $value, $valueCaption)
 {
     $subject = $this->parserData->getSubject();
     // Add properties to the semantic container
     foreach ($properties as $property) {
         $dataValue = $this->dataValueFactory->newPropertyValue($property, $value, $valueCaption, $subject);
         if ($this->isEnabledNamespace && $this->isAnnotation) {
             $this->parserData->addDataValue($dataValue);
         }
     }
     // Return the text representation
     $result = $dataValue->getShortWikitext(true);
     // If necessary add an error text
     if ($this->settings->get('smwgInlineErrors') && $this->isEnabledNamespace && $this->isAnnotation && !$dataValue->isValid()) {
         // Encode `:` to avoid a comment block and instead of the nowiki tag
         // use : as placeholder
         $result = str_replace(':', ':', $result) . $dataValue->getErrorText();
     }
     return $result;
 }
開發者ID:WolfgangFahl,項目名稱:SemanticMediaWiki,代碼行數:29,代碼來源:InTextAnnotationParser.php


注:本文中的SMW\DataValueFactory::newPropertyValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。