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


PHP core_kernel_classes_Resource::duplicate方法代碼示例

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


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

示例1: testInstanceDuplicate

 /**
  * test delete test instance
  * @depends testInstanceCreate
  * @param \core_kernel_classes_Resource $testInstance
  * @return void
  */
 public function testInstanceDuplicate($testInstance)
 {
     $duplicate = $testInstance->duplicate();
     $this->assertTrue($duplicate->exists());
     $this->assertNotEquals($testInstance->getUri(), $duplicate->getUri());
     $this->assertEquals('unittest test', $duplicate->getLabel());
     $duplicate->delete();
 }
開發者ID:nagyist,項目名稱:extension-tao-testwf,代碼行數:14,代碼來源:ServiceTest.php

示例2: cloneContent

 /**
  * (non-PHPdoc)
  * @see taoTests_models_classes_TestModel::cloneContent()
  */
 public function cloneContent(core_kernel_classes_Resource $content)
 {
     return $content->duplicate();
 }
開發者ID:nagyist,項目名稱:extension-tao-deliverysimple,代碼行數:8,代碼來源:class.ContentModel.php

示例3: duplicateActivityExecutionVariables

 /**
  * Short description of method duplicateActivityExecutionVariables
  *
  * @access public
  * @author Somsack Sipasseuth, <somsack.sipasseuth@tudor.lu>
  * @param  Resource oldActivityExecution
  * @param  Resource newActivityDefinition
  * @param  Resource processExecution
  * @return core_kernel_classes_Resource
  */
 public function duplicateActivityExecutionVariables(core_kernel_classes_Resource $oldActivityExecution, core_kernel_classes_Resource $newActivityDefinition, core_kernel_classes_Resource $processExecution)
 {
     $returnValue = null;
     $excludedProperties = array(RDFS_LABEL, PROPERTY_ACTIVITY_EXECUTION_CURRENT_USER, PROPERTY_ACTIVITY_EXECUTION_ACTIVITY, PROPERTY_ACTIVITY_EXECUTION_CTX_RECOVERY, PROPERTY_ACTIVITY_EXECUTION_PREVIOUS, PROPERTY_ACTIVITY_EXECUTION_FOLLOWING, PROPERTY_ACTIVITY_EXECUTION_STATUS, PROPERTY_ACTIVITY_EXECUTION_TIME_CREATED, PROPERTY_ACTIVITY_EXECUTION_TIME_STARTED, PROPERTY_ACTIVITY_EXECUTION_TIME_LASTACCESS, PROPERTY_ACTIVITY_EXECUTION_ACL_MODE, PROPERTY_ACTIVITY_EXECUTION_RESTRICTED_USER, PROPERTY_ACTIVITY_EXECUTION_RESTRICTED_ROLE);
     $newActivityExecution = $oldActivityExecution->duplicate($excludedProperties);
     $newActivityExecution->setPropertyValue($this->activityProperty, $newActivityDefinition->getUri());
     $newActivityExecution->setPropertyValue(new core_kernel_classes_Property(PROPERTY_ACTIVITY_EXECUTION_TIME_CREATED), time());
     //apply activity ACL from definition:
     $this->applyAclDefinitionToExecution($newActivityDefinition, $newActivityExecution);
     if ($processExecution->setPropertyValue($this->processInstanceActivityExecutionsProperty, $newActivityExecution->getUri())) {
         $returnValue = $newActivityExecution;
     }
     return $returnValue;
 }
開發者ID:nagyist,項目名稱:extension-tao-wfengine,代碼行數:24,代碼來源:class.ActivityExecutionService.php

示例4: cloneWfResource

 /**
  * Short description of method cloneWfResource
  *
  * @access protected
  * @author Joel Bout, <joel.bout@tudor.lu>
  * @param  Resource instance
  * @param  Class clazz
  * @param  array forbiddenProperties
  * @param  string newLabel
  * @return core_kernel_classes_Resource
  */
 protected function cloneWfResource(core_kernel_classes_Resource $instance, core_kernel_classes_Class $clazz, $forbiddenProperties = array(), $newLabel = '')
 {
     $returnValue = null;
     $returnValue = $instance->duplicate($forbiddenProperties);
     if (!is_null($returnValue)) {
         $cloneLabel = empty($newLabel) ? $instance->getLabel() . $this->cloneLabel : $newLabel;
         $returnValue->setLabel($cloneLabel);
     }
     return $returnValue;
 }
開發者ID:oat-sa,項目名稱:extension-tao-wfauthoring,代碼行數:21,代碼來源:class.ProcessCloner.php


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