本文整理汇总了PHP中Attachments::copyAttachment方法的典型用法代码示例。如果您正苦于以下问题:PHP Attachments::copyAttachment方法的具体用法?PHP Attachments::copyAttachment怎么用?PHP Attachments::copyAttachment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attachments
的用法示例。
在下文中一共展示了Attachments::copyAttachment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: merge
//.........这里部分代码省略.........
$isHot,
$email,
$emailAddress,
$gender,
$race,
$veteran,
$disability
);
if (!$updateSuccess)
{
CommonErrors::fatal(COMMONERROR_RECORDERROR, $this, 'Failed to update candidate.');
}
/* Update extra fields. */
$candidates->extraFields->setValuesOnEdit($candidateID);
/* Update possible source list */
$sources = $candidates->getPossibleSources();
$sourcesDifferences = ListEditor::getDifferencesFromList(
$sources, 'name', 'sourceID', $sourceCSV
);
$candidates->updatePossibleSources($sourcesDifferences);
//else
//{
/* Associate an exsisting resume if the user created a candidate with one. (Bulk) */
if (isset($_POST['associatedAttachment']))
{
$attachmentID = $_POST['associatedAttachment'];
$attachments = new Attachments($this->_siteID);
$newAttachmentID=$attachments->copyAttachment(DATA_ITEM_CANDIDATE, $candidateID, $attachmentID);
//trace($newAttachmentID);
//$attachments->setDataItemID($newAttachmentID, $candidateID, DATA_ITEM_CANDIDATE);
}
/* Attach a resume if the user uploaded one. (http POST) */
/* NOTE: This function cannot be called if parsing is enabled */
else if (isset($_FILES['file']) && !empty($_FILES['file']['name']))
{
if (!eval(Hooks::get('CANDIDATE_ON_CREATE_ATTACHMENT_PRE'))) return;
$attachmentCreator = new AttachmentCreator($this->_siteID);
$attachmentCreator->createFromUpload(
DATA_ITEM_CANDIDATE, $candidateID, 'file', false, true
);
if ($attachmentCreator->isError())
{
CommonErrors::fatal(COMMONERROR_FILEERROR, $this, $attachmentCreator->getError());
}
if ($attachmentCreator->duplicatesOccurred())
{
$this->listByView(
'This attachment has already been added to this candidate.'
);
return;
}
$isTextExtractionError = $attachmentCreator->isTextExtractionError();
$textExtractionErrorMessage = $attachmentCreator->getTextExtractionError();