', 20000);
The class implements the IPipelineSection interface, then a private field for storing a reference
to the OrderProcessor that invoked the PsInitialNotification, and finally the Process()
method implementation. This method starts by storing the reference to OrderProcessor, which
some of your pipeline sections will do because using the methods it exposes (either in the
Process() method or in other methods) is essential. We also add an audit entry using the codes
scheme introduced in Chapter 18 (the initial 2 indicates it??™s coming from a pipeline section; the
next 00 shows that it??™s the first pipeline section; and the final 00 means that it??™s the start message
for the pipeline section).
The remainder of the Process() method sends the notification e-mail. This requires
information from the customer, which we have easy access to. We also use a private method
to build amessage body, which we??™ll look at shortly:
// Send mail to customer
$processor->MailCustomer(STORE_NAME . ' order received.',
$this->GetMailBody());
The mail is sent; we add an audit message, change the status of the order, and tell the
order processor that it??™s OK to move straight on to the next pipeline section:
// Audit
$processor->CreateAudit('Notification e-mail sent to customer.', 20002);
// Update order status
$processor->UpdateOrderStatus(1);
CHAPTER 19 ?– IMPLEMENTING THE ORDER PIPELINE: PART 2 594
// Continue processing
$processor->mContinueNow = true;
If all goes according to plan, the Process() method finishes by adding a final audit entry:
// Audit
$processor->CreateAudit('PsInitialNotification finished.
Pages:
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713