本文整理汇总了PHP中UploadFile::set_for_soap方法的典型用法代码示例。如果您正苦于以下问题:PHP UploadFile::set_for_soap方法的具体用法?PHP UploadFile::set_for_soap怎么用?PHP UploadFile::set_for_soap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UploadFile
的用法示例。
在下文中一共展示了UploadFile::set_for_soap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Note
if (!empty($_REQUEST['parent_module'])) {
$note = new Note();
$note->name = $focus->name;
if ($zuckerreports_config["debug"] == "yes") {
$note->description = $focus->report_output;
}
$note->filename = $focus->report_result_name;
if ($_REQUEST['parent_module'] == 'Contacts') {
$note->contact_id = $_REQUEST['parent_id'];
} else {
$note->parent_type = $_REQUEST['parent_module'];
$note->parent_id = $_REQUEST['parent_id'];
}
$note->save();
$uf = new UploadFile("upload");
$uf->set_for_soap($focus->report_result_name, file_get_contents($focus->report_result));
$uf->stored_file_name = $uf->create_stored_filename();
$uf->final_move($note->id);
$note_url = "index.php?action=DetailView&module=Notes&record=" . $note->id . "&return_module=ZuckerReports&return_action=ReportOnDemand";
}
if (!empty($_REQUEST['send_email'])) {
$mail = new SugarPHPMailer();
$emails = split(",", $_REQUEST['send_email']);
foreach ($emails as $email) {
$mail->AddAddress($email);
}
$admin = new Administration();
$admin->retrieveSettings();
if ($admin->settings['mail_sendtype'] == "SMTP") {
$mail->Mailer = "smtp";
$mail->Host = $admin->settings['mail_smtpserver'];
示例2: createNote
/**
* Create a new Note object
* @param array $data Note data
* @param Email $email parent email
*/
protected function createNote($data, $email)
{
require_once 'include/upload_file.php';
$upload_file = new UploadFile('uploadfile');
$decodedFile = base64_decode($data['content']);
$upload_file->set_for_soap($data['filename'], $decodedFile);
$ext_pos = strrpos($upload_file->stored_file_name, ".");
$upload_file->file_ext = substr($upload_file->stored_file_name, $ext_pos + 1);
$note = BeanFactory::getBean('Notes');
$note->id = create_guid();
$note->new_with_id = true;
if (in_array($upload_file->file_ext, $this->config['upload_badext'])) {
$upload_file->stored_file_name .= ".txt";
$upload_file->file_ext = "txt";
}
$note->filename = $upload_file->get_stored_file_name();
if (isset($data['type'])) {
$note->file_mime_type = $data['type'];
} else {
$note->file_mime_type = $upload_file->getMimeSoap($note->filename);
}
$note->team_id = $email->team_id;
$note->team_set_id = $email->team_set_id;
$note->assigned_user_id = $email->assigned_user_id;
$note->parent_type = 'Emails';
$note->parent_id = $email->id;
$note->name = $note->filename;
$note->save();
$upload_file->final_move($note->id);
}