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


PHP DIProperty::isShown方法代碼示例

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


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

示例1: addPropertyObjectValue

 /**
  * Store a value for a property identified by its SMWDataItem object.
  *
  * @note There is no check whether the type of the given data item
  * agrees with the type of the property. Since property types can
  * change, all parts of SMW are prepared to handle mismatched data item
  * types anyway.
  *
  * @param $property DIProperty
  * @param $dataItem SMWDataItem
  */
 public function addPropertyObjectValue(DIProperty $property, SMWDataItem $dataItem)
 {
     $this->hash = null;
     if ($dataItem instanceof SMWDIContainer) {
         $this->addSubSemanticData($dataItem->getSemanticData());
         $dataItem = $dataItem->getSemanticData()->getSubject();
     }
     if ($property->isInverse()) {
         // inverse properties cannot be used for annotation
         return;
     }
     if (!array_key_exists($property->getKey(), $this->mPropVals)) {
         $this->mPropVals[$property->getKey()] = array();
         $this->mProperties[$property->getKey()] = $property;
     }
     if ($this->mNoDuplicates) {
         $this->mPropVals[$property->getKey()][$dataItem->getHash()] = $dataItem;
     } else {
         $this->mPropVals[$property->getKey()][] = $dataItem;
     }
     if (!$property->isUserDefined()) {
         if ($property->isShown()) {
             $this->mHasVisibleSpecs = true;
             $this->mHasVisibleProps = true;
         }
     } else {
         $this->mHasVisibleProps = true;
     }
     // Inherit the sortkey from the root if not explicitly given
     if ($this->mSubject->getSubobjectName() === '' && $property->getKey() === DIProperty::TYPE_SORTKEY) {
         foreach ($this->subSemanticData as $subSemanticData) {
             if (!$subSemanticData->hasProperty($property)) {
                 $subSemanticData->addPropertyObjectValue($property, $dataItem);
             }
         }
     }
 }
開發者ID:jongfeli,項目名稱:SemanticMediaWiki,代碼行數:48,代碼來源:SemanticData.php

示例2: addPropertyObjectValue

 /**
  * Store a value for a property identified by its SMWDataItem object.
  *
  * @note There is no check whether the type of the given data item
  * agrees with the type of the property. Since property types can
  * change, all parts of SMW are prepared to handle mismatched data item
  * types anyway.
  *
  * @param $property DIProperty
  * @param $dataItem SMWDataItem
  */
 public function addPropertyObjectValue(DIProperty $property, SMWDataItem $dataItem)
 {
     if ($dataItem instanceof SMWDIContainer) {
         $this->addSubSemanticData($dataItem->getSemanticData());
         $dataItem = $dataItem->getSemanticData()->getSubject();
     }
     if ($property->isInverse()) {
         // inverse properties cannot be used for annotation
         return;
     }
     if (!array_key_exists($property->getKey(), $this->mPropVals)) {
         $this->mPropVals[$property->getKey()] = array();
         $this->mProperties[$property->getKey()] = $property;
     }
     if ($this->mNoDuplicates) {
         $this->mPropVals[$property->getKey()][$dataItem->getHash()] = $dataItem;
     } else {
         $this->mPropVals[$property->getKey()][] = $dataItem;
     }
     if (!$property->isUserDefined()) {
         if ($property->isShown()) {
             $this->mHasVisibleSpecs = true;
             $this->mHasVisibleProps = true;
         }
     } else {
         $this->mHasVisibleProps = true;
     }
 }
開發者ID:whysasse,項目名稱:kmwiki,代碼行數:39,代碼來源:SemanticData.php

示例3: unstubProperty

 /**
  * Unstub a single property from the stub data array. If available, an
  * existing object for that property might be provided, so we do not
  * need to make a new one. It is not checked if the object matches the
  * property name.
  *
  * @since 1.8
  *
  * @param string $propertyKey
  * @param SMWDIProperty $diProperty if available
  * @throws SMWDataItemException if property key is not valid
  * 	and $diProperty is null
  */
 protected function unstubProperty($propertyKey, $diProperty = null)
 {
     if (!array_key_exists($propertyKey, $this->mProperties)) {
         if (is_null($diProperty)) {
             $diProperty = new DIProperty($propertyKey, false);
         }
         $this->mProperties[$propertyKey] = $diProperty;
         if (!$diProperty->isUserDefined()) {
             if ($diProperty->isShown()) {
                 $this->mHasVisibleSpecs = true;
                 $this->mHasVisibleProps = true;
             }
         } else {
             $this->mHasVisibleProps = true;
         }
     }
 }
開發者ID:brandonphuong,項目名稱:mediawiki,代碼行數:30,代碼來源:SMW_Sql3StubSemanticData.php


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