/** * Delivers ordered product * * @param OW_BillingProductAdapter $adapter * @param BOL_BillingSale $sale * @return int */ public function deliverSale(OW_BillingProductAdapter $adapter, BOL_BillingSale $sale) { if (!$this->getSaleById($sale->id)) { return false; } if ($adapter->deliverSale($sale)) { $sale->status = BOL_BillingSaleDao::STATUS_DELIVERED; $this->saveSale($sale); $event = new OW_Event(self::EVENT_ON_AFTER_DELIVER_SALE, array("saleDbo" => $sale, "adapter" => $adapter)); OW::getEventManager()->trigger($event); return true; } return false; }
/** * Delivers ordered product * * @param OW_BillingProductAdapter $adapter * @param BOL_BillingSale $sale * @return int */ public function deliverSale(OW_BillingProductAdapter $adapter, BOL_BillingSale $sale) { if (!$this->getSaleById($sale->id)) { return false; } if ($adapter->deliverSale($sale)) { $sale->status = BOL_BillingSaleDao::STATUS_DELIVERED; $this->saveSale($sale); return true; } return false; }