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


PHP core_kernel_classes_Resource::setLabel方法代碼示例

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


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

示例1: addPrefixToLabel

 /**
  * @param \core_kernel_classes_Resource $delivery
  */
 private function addPrefixToLabel(\core_kernel_classes_Resource $delivery)
 {
     $label = $delivery->getLabel();
     $label .= " - old";
     //todo: use an option instead of hardcoded value
     $delivery->setLabel($label);
 }
開發者ID:oat-sa,項目名稱:extension-tao-delivery-rdf,代碼行數:10,代碼來源:RecompileDelivery.php

示例2: storeDelivery

 /**
  * @param string deliveryIdentifier (uri recommended)
  */
 public function storeDelivery(core_kernel_classes_Resource $deliveryResult, $deliveryIdentifier)
 {
     $propResultOfDelivery = new core_kernel_classes_Property(PROPERTY_RESULT_OF_DELIVERY);
     $deliveryResult->editPropertyValues($propResultOfDelivery, $deliveryIdentifier);
     try {
         //if the delviery information is provided, update to a more meaningful delvieryResult Label
         $delivery = new core_kernel_classes_Resource($deliveryIdentifier);
         $deliveryLabel = $delivery->getLabel();
         $deliveryResult->setLabel(str_replace("-" . $deliveryLabel, "", $deliveryResult->getLabel()) . "-" . $deliveryLabel);
     } catch (Exception $e) {
         //the test taker to be referrd in the delivery Result does not exist (or the label is not stated)
     }
 }
開發者ID:oat-sa,項目名稱:extension-tao-outcomerdf,代碼行數:16,代碼來源:class.ResultsService.php

示例3: createInstance

 /**
  * (non-PHPdoc)
  * @see core_kernel_persistence_ClassInterface::createInstance()
  */
 public function createInstance(core_kernel_classes_Class $resource, $label = '', $comment = '', $uri = '')
 {
     $returnValue = null;
     $subject = '';
     if ($uri == '') {
         $subject = common_Utils::getNewUri();
     } else {
         if ($uri[0] == '#') {
             //$uri should start with # and be well formed
             $modelUri = common_ext_NamespaceManager::singleton()->getLocalNamespace()->getUri();
             $subject = rtrim($modelUri, '#') . $uri;
         } else {
             $subject = $uri;
         }
     }
     $returnValue = new core_kernel_classes_Resource($subject, __METHOD__);
     if (!$returnValue->hasType($resource)) {
         $returnValue->setType($resource);
     } else {
         common_Logger::e('already had type ' . $resource);
     }
     if (!empty($label)) {
         $returnValue->setLabel($label);
     }
     if (!empty($comment)) {
         $returnValue->setComment($comment);
     }
     return $returnValue;
 }
開發者ID:nagyist,項目名稱:generis,代碼行數:33,代碼來源:class.Class.php


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