本文整理匯總了PHP中Orders::cloneOrder方法的典型用法代碼示例。如果您正苦於以下問題:PHP Orders::cloneOrder方法的具體用法?PHP Orders::cloneOrder怎麽用?PHP Orders::cloneOrder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Orders
的用法示例。
在下文中一共展示了Orders::cloneOrder方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: renewAction
/**
* renewAction
* Renew the order
* @return unknown_type
*/
public function renewAction()
{
$id = $this->getRequest()->getParam('id');
if (!is_numeric($id)) {
$this->_helper->redirector('list', 'orders', 'default');
}
if (Orders::isOwner($id, $this->customer['customer_id'])) {
$id = Orders::cloneOrder($id, null, true);
}
$this->_helper->redirector('edit', 'orders', 'default', array('id' => $id, 'mex' => 'The requested task has been completed successfully', 'status' => 'success'));
die($id);
}
示例2: cloneAction
public function cloneAction()
{
$request = $this->getRequest();
if (isset($request->id) && is_numeric($request->id)) {
$newOrderId = Orders::cloneOrder($request->id);
if (is_numeric($newOrderId)) {
$this->_helper->redirector('edit', 'orders', 'admin', array('id' => $newOrderId, 'mex' => 'The task requested has been executed successfully.', 'status' => 'success'));
} else {
$this->_helper->redirector('edit', 'orders', 'admin', array('id' => $request->id, 'mex' => $this->translator->translate('Order has been not cloned'), 'status' => 'danger'));
}
}
$this->_helper->redirector('list', 'orders', 'admin');
}