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


PHP DIProperty::getCanonicalLabel方法代码示例

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


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

示例1: getQueryString

 public function getQueryString($asValue = false)
 {
     $subDescription = $this->description;
     // Use the canonical label to ensure that conditions contain
     // language indep. references
     $propertyChainString = $this->property->getCanonicalLabel();
     $propertyname = $propertyChainString;
     while ($propertyname !== '' && $subDescription instanceof SomeProperty) {
         // try to use property chain syntax
         $propertyname = $subDescription->getProperty()->getCanonicalLabel();
         if ($propertyname !== '') {
             $propertyChainString .= '.' . $propertyname;
             $subDescription = $subDescription->getDescription();
         }
     }
     if ($asValue) {
         return '<q>[[' . $propertyChainString . '::' . $subDescription->getQueryString(true) . ']]</q>';
     }
     return '[[' . $propertyChainString . '::' . $subDescription->getQueryString(true) . ']]';
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:20,代码来源:SomeProperty.php

示例2: findPropertyIdByLabel

 private function findPropertyIdByLabel($label)
 {
     $property = new DIProperty(PropertyRegistry::getInstance()->findPropertyIdByLabel($label));
     $canonicalLabel = $property->getCanonicalLabel();
     // #1966 and #1968
     // In case something goes wrong, a recursive loop will kill PHP
     // and we know we messed up
     if ($canonicalLabel !== '' && $label !== $canonicalLabel) {
         $this->findPropertyIdByLabel($property->getCanonicalDiWikiPage()->getTitle()->getText());
     }
     return array($label, $property);
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:12,代码来源:PropertyLabelCanonicalMatchTest.php

示例3: testCanonicalRepresentation

 public function testCanonicalRepresentation()
 {
     $property = new DIProperty('_MDAT');
     $this->assertEquals('Modification date', $property->getCanonicalLabel());
     $this->assertEquals(new DIWikiPage('Modification_date', SMW_NS_PROPERTY), $property->getCanonicalDiWikiPage());
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:6,代码来源:DIPropertyTest.php

示例4: findBasePropertyToRedirectFor

 private function findBasePropertyToRedirectFor($label)
 {
     $property = new DIProperty(PropertyRegistry::getInstance()->findPropertyIdByLabel($label));
     // Ensure to redirect to `Property:Modification date` and not using
     // a possible user contextualized version such as `Property:Date de modification`
     $canonicalLabel = $property->getCanonicalLabel();
     if ($canonicalLabel !== '' && $label !== $canonicalLabel) {
         $outputPage = $this->getContext()->getOutput();
         $outputPage->redirect($property->getCanonicalDiWikiPage()->getTitle()->getFullURL());
     }
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:11,代码来源:SMW_OrderedListPage.php


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