', 99999);
$processor->CreateAudit('Customer: ' .
$processor->mCustomerInfo['name'], 99999);
$processor->CreateAudit('Order subtotal: ' .
$processor->mOrderInfo['total_amount'], 99999);
$processor->MailAdmin('Test.', 'Test mail from PsDummy.', 99999);
$processor->CreateAudit('PsDoNothing finished', 99999);
}
}
?>
The code here uses the CreateAudit() and MailAdmin() methods of OrderProcessor to generate something
to show that the code has executed correctly. Note that the code schemes outlined previously aren??™t used
there because this isn??™t a real pipeline section!
That was a lot of code to get through, but it did make the client code very simple.
CHAPTER 18 ?– IMPLEMENTING THE ORDER PIPELINE: PART 1 585
Short of setting all the configuration details, there is very little to do because OrderProcessor does a lot of the
work for you. Note that the code we have ended up with is, for the most part, a consequence of the design choices
made earlier. This is an excellent example of how a strong design can lead you straight to powerful and robust code.
Updating the Orders Processing Code
We need to add a few more bits and pieces to the OrderProcessor class, and we will do so by
going through a number of short exercises. These exercises implement the features that were
listed in the beginning of the chapter:
??? Updating the status of an order
??? Setting credit card authentication details
??? Setting the order shipment date
??? Sending e-mails to customers and suppliers
??? Retrieving order details and the customer address
We??™ll start by writing the code that permits updating the status of an order.
Pages:
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704