本文整理汇总了PHP中Eccube\Framework\Util\Utils::sfTrim方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils::sfTrim方法的具体用法?PHP Utils::sfTrim怎么用?PHP Utils::sfTrim使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Eccube\Framework\Util\Utils
的用法示例。
在下文中一共展示了Utils::sfTrim方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sfSendOrderMail
public function sfSendOrderMail($order_id, $template_id, $subject = '', $header = '', $footer = '', $send = true)
{
$arrTplVar = new \stdClass();
$arrInfo = Application::alias('eccube.helper.db')->getBasisData();
$arrTplVar->arrInfo = $arrInfo;
$objQuery = Application::alias('eccube.query');
if ($subject == '' && $header == '' && $footer == '') {
// メールテンプレート情報の取得
/* @var $objMailtemplate MailtemplateHelper */
$objMailtemplate = Application::alias('eccube.helper.mailtemplate');
$mailtemplate = $objMailtemplate->get($template_id);
$arrTplVar->tpl_header = $mailtemplate['header'];
$arrTplVar->tpl_footer = $mailtemplate['footer'];
$tmp_subject = $mailtemplate['subject'];
} else {
$arrTplVar->tpl_header = $header;
$arrTplVar->tpl_footer = $footer;
$tmp_subject = $subject;
}
// 受注情報の取得
$where = 'order_id = ? AND del_flg = 0';
$arrOrder = $objQuery->getRow('*', 'dtb_order', $where, array($order_id));
if (empty($arrOrder)) {
trigger_error("該当する受注が存在しない。(注文番号: {$order_id})", E_USER_ERROR);
}
$where = 'order_id = ?';
$objQuery->setOrder('order_detail_id');
$arrTplVar->arrOrderDetail = $objQuery->select('*', 'dtb_order_detail', $where, array($order_id));
// 配送情報の取得
$arrTplVar->arrShipping = $this->sfGetShippingData($order_id);
$arrTplVar->Message_tmp = $arrOrder['message'];
// 会員情報の取得
$customer_id = $arrOrder['customer_id'];
$objQuery->setOrder('customer_id');
$arrRet = $objQuery->select('point', 'dtb_customer', 'customer_id = ?', array($customer_id));
$arrCustomer = isset($arrRet[0]) ? $arrRet[0] : '';
$arrTplVar->arrCustomer = $arrCustomer;
$arrTplVar->arrOrder = $arrOrder;
//その他決済情報
if ($arrOrder['memo02'] != '') {
$arrOther = unserialize($arrOrder['memo02']);
foreach ($arrOther as $other_key => $other_val) {
if (Utils::sfTrim($other_val['value']) == '') {
$arrOther[$other_key]['value'] = '';
}
}
$arrTplVar->arrOther = $arrOther;
}
// 都道府県変換
$arrTplVar->arrPref = $this->arrPref;
// 国変換
$arrTplVar->arrCountry = $this->arrCountry;
/* @var $objCustomer Customer */
$objCustomer = Application::alias('eccube.customer');
$arrTplVar->tpl_user_point = $objCustomer->getValue('point');
$objMailView = null;
// 注文受付メール(携帯)
if ($template_id == 2) {
$objMailView = new SiteView(true, DEVICE_TYPE_MOBILE);
} else {
$objMailView = new SiteView();
}
// メール本文の取得
$objMailView->setPage($this->getPage());
$objMailView->assignobj($arrTplVar);
$body = $objMailView->fetch($this->arrMAILTPLPATH[$template_id]);
// メール送信処理
/* @var $objSendMail Sendmail */
$objSendMail = Application::alias('eccube.sendmail');
$bcc = $arrInfo['email01'];
$from = $arrInfo['email03'];
$error = $arrInfo['email04'];
$tosubject = $this->sfMakeSubject($tmp_subject, $objMailView);
$objSendMail->setItem('', $tosubject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc);
$objSendMail->setTo($arrOrder['order_email'], $arrOrder['order_name01'] . ' ' . $arrOrder['order_name02'] . ' 様');
// 送信フラグ:trueの場合は、送信する。
if ($send) {
if ($objSendMail->sendMail()) {
$this->sfSaveMailHistory($order_id, $template_id, $tosubject, $body);
}
}
return $objSendMail;
}