1 | <?php |
||
19 | class SendProductPurchase implements ObserverInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var Config |
||
23 | */ |
||
24 | private $_config; |
||
25 | |||
26 | /** |
||
27 | * @var CustomerSession |
||
28 | */ |
||
29 | private $_customerSession; |
||
30 | |||
31 | /** |
||
32 | * @var |
||
33 | */ |
||
34 | private $_eventClient; |
||
35 | |||
36 | /** |
||
37 | * SendProductPurchase constructor. |
||
38 | * @param Config $config |
||
39 | * @param CustomerSession $customerSession |
||
40 | * @param Client $eventClient |
||
41 | */ |
||
42 | public function __construct( |
||
51 | |||
52 | /** |
||
53 | * Check the customer has an account and send the order product colllection |
||
54 | * to PredictionIO |
||
55 | * |
||
56 | * @param Observer $observer |
||
57 | */ |
||
58 | public function execute(Observer $observer) |
||
71 | |||
72 | /** |
||
73 | * Record a customer-buys-product event in PredictionIO when the customer |
||
74 | * completes an order |
||
75 | * |
||
76 | * @param $productCollection |
||
77 | */ |
||
78 | private function _sendPurchaseEvent($productCollection) |
||
91 | } |
||
92 |