当前位置: 首页>>代码示例>>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;未经允许,请勿转载。