Ordinary.php 845 Bytes
<?php

/**
 * Created by PhpStorm.
 * User: ziy
 * Date: 14-8-1
 * Time: 下午3:52
 */
class YHMCart_Orders_Ordinary extends YHMCart_Orders_Abstract
{
    /**
     * 创建订单
     * @param array $orderData
     * @return array
     */
    public function create(array $orderData)
    {
        $hookOrders = new YHMCart_Hook_Orders();
        $hookOrders->setOrder($orderData);
        #################### 创建初始化 ####################
        $this->createPreDispatch($hookOrders);

        #################### 创建本地订单 ####################
        YHMOrders_Models_Shopping_Client::create($hookOrders->getOrder());
        #################### 创建成功后 ####################
        $this->createEndDispatch($hookOrders);
        return $hookOrders->getOrder();
    }

    public function cancel()
    {

    }
}