本文整理汇总了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');
}