本文整理汇总了PHP中Workflow::getWorkflowID方法的典型用法代码示例。如果您正苦于以下问题:PHP Workflow::getWorkflowID方法的具体用法?PHP Workflow::getWorkflowID怎么用?PHP Workflow::getWorkflowID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Workflow
的用法示例。
在下文中一共展示了Workflow::getWorkflowID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: enterNewWorkflow
public function enterNewWorkflow()
{
$config = new Configuration();
//remove any current workflow steps
$this->removeResourceSteps();
//make sure this resource is marked in progress in case it was archived
$status = new Status();
$this->statusID = $status->getIDFromName('progress');
$this->save();
//Determine the workflow this resource belongs to
$workflowObj = new Workflow();
$workflowID = $workflowObj->getWorkflowID($this->resourceTypeID, $this->resourceFormatID, $this->acquisitionTypeID);
if ($workflowID) {
$workflow = new Workflow(new NamedArguments(array('primaryKey' => $workflowID)));
//Copy all of the step attributes for this workflow to a new resource step
foreach ($workflow->getSteps() as $step) {
$resourceStep = new ResourceStep();
$resourceStep->resourceStepID = '';
$resourceStep->resourceID = $this->resourceID;
$resourceStep->stepID = $step->stepID;
$resourceStep->priorStepID = $step->priorStepID;
$resourceStep->stepName = $step->stepName;
$resourceStep->userGroupID = $step->userGroupID;
$resourceStep->displayOrderSequence = $step->displayOrderSequence;
$resourceStep->save();
}
//Start the first step
//this handles updating the db and sending notifications for approval groups
foreach ($this->getFirstSteps() as $resourceStep) {
$resourceStep->startStep();
}
}
//send an email notification to the feedback email address and the creator
$cUser = new User(new NamedArguments(array('primaryKey' => $this->createLoginID)));
$acquisitionType = new AcquisitionType(new NamedArguments(array('primaryKey' => $this->acquisitionTypeID)));
if ($cUser->firstName) {
$creator = $cUser->firstName . " " . $cUser->lastName;
} else {
if ($this->createLoginID) {
//for some reason user isn't set up or their firstname/last name don't exist
$creator = $this->createLoginID;
} else {
$creator = "(unknown user)";
}
}
if ($config->settings->feedbackEmailAddress || $cUser->emailAddress) {
$email = new Email();
$util = new Utility();
$email->message = $util->createMessageFromTemplate('NewResourceMain', $this->resourceID, $this->titleText, '', '', $creator);
if ($cUser->emailAddress) {
$emailTo[] = $cUser->emailAddress;
}
if ($config->settings->feedbackEmailAddress != '') {
$emailTo[] = $config->settings->feedbackEmailAddress;
}
$email->to = implode(",", $emailTo);
if ($acquisitionType->shortName) {
$email->subject = "CORAL Alert: New " . $acquisitionType->shortName . " Resource Added: " . $this->titleText;
} else {
$email->subject = "CORAL Alert: New Resource Added: " . $this->titleText;
}
$email->send();
}
}
示例2: attachWorkflow
public function attachWorkflow(Workflow $wf) {
$db = Loader::db();
$db->Replace('PermissionAccessWorkflows', array('paID' => $this->getPermissionAccessID(), 'wfID' => $wf->getWorkflowID()), array('paID', 'wfID'), true);
}
示例3: add
/**
* Creates a WorkflowProgress object (which will be assigned to a Page, File, etc... in our system.
*/
public static function add($wpCategoryHandle, Workflow $wf, WorkflowRequest $wr)
{
$db = Loader::db();
$wpDateAdded = Loader::helper('date')->getLocalDateTime();
$wpCategoryID = $db->GetOne('select wpCategoryID from WorkflowProgressCategories where wpCategoryHandle = ?', array($wpCategoryHandle));
$db->Execute('insert into WorkflowProgress (wfID, wrID, wpDateAdded, wpCategoryID) values (?, ?, ?, ?)', array($wf->getWorkflowID(), $wr->getWorkflowRequestID(), $wpDateAdded, $wpCategoryID));
$wp = self::getByID($db->Insert_ID());
$wp->addWorkflowProgressHistoryObject($wr);
return $wp;
}