Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace NicolasBejean\Customer\Plugin;
use NicolasBejean\Customer\Helper\SendGeoLocation;
/**
* Class ModelAddress
*
* @category PHP
* @package NicolasBejean\Customer\Plugin
* @author Nicolas Béjean <nicolas@bejean.eu>
* @license https://lab.frogg.it/bejean-developpement/magento-2/modules/customer/-/blob/master/LICENCE GPL3 Licence
* @link https://www.bejean.eu
*/
class ModelAddress
{
/**
* @var SendGeoLocation
*/
private SendGeoLocation $helper;
/**
* ModelAddress constructor.
*
* @param SendGeoLocation $helper
*/
public function __construct(
SendGeoLocation $helper
) {
$this->helper = $helper;
}
/**
* @param \Magento\Customer\Model\Address $subject
*/
public function afterSave(\Magento\Customer\Model\Address $subject)
{
$customer = $subject->getCustomer();
$this->helper->sendDataToApi($customer, $subject);
}
}