本文整理汇总了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();
}
示例2: cloneContent
/**
* (non-PHPdoc)
* @see taoTests_models_classes_TestModel::cloneContent()
*/
public function cloneContent(core_kernel_classes_Resource $content)
{
return $content->duplicate();
}
示例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;
}
示例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;
}