Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AfterAddressSave.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Weee\Observer;
7 
15 
17 {
21  protected $weeeHelper;
22 
28  private $moduleManager;
29 
35  private $cacheConfig;
36 
42  private $addressManager;
43 
50  public function __construct(
52  Manager $moduleManager,
53  Config $cacheConfig,
54  TaxAddressManagerInterface $addressManager
55  ) {
56  $this->weeeHelper = $weeeHelper;
57  $this->moduleManager = $moduleManager;
58  $this->cacheConfig = $cacheConfig;
59  $this->addressManager = $addressManager;
60  }
61 
67  public function execute(Observer $observer)
68  {
69  if ($this->moduleManager->isEnabled('Magento_PageCache')
70  && $this->cacheConfig->isEnabled()
71  && $this->weeeHelper->isEnabled()
72  ) {
74  $address = $observer->getCustomerAddress();
75  $this->addressManager->setDefaultAddressAfterSave($address);
76  }
77  }
78 }
$address
Definition: customer.php:38
$moduleManager
Definition: products.php:75
__construct(Data $weeeHelper, Manager $moduleManager, Config $cacheConfig, TaxAddressManagerInterface $addressManager)