Skip to content

Commit d08749c

Browse files
author
nsyvokonenko
committed
Merge remote-tracking branch 'origin/MAGETWO-28011' into MAGETWO-28011
2 parents 5eaf8b5 + c0a66c8 commit d08749c

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

app/code/Magento/Customer/Api/Data/CustomerInterface.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ interface CustomerInterface extends \Magento\Framework\Api\CustomAttributesDataI
3232
const DEFAULT_BILLING = 'default_billing';
3333
const DEFAULT_SHIPPING = 'default_shipping';
3434
const KEY_ADDRESSES = 'addresses';
35+
const DISABLE_AUTO_GROUP_CHANGE = 'disable_auto_group_change';
3536
/**#@-*/
3637

3738
/**
@@ -357,6 +358,23 @@ public function getAddresses();
357358
*/
358359
public function setAddresses(array $addresses = null);
359360

361+
/**
362+
* Get disable auto group change flag.
363+
*
364+
* @api
365+
* @return int|null
366+
*/
367+
public function getDisableAutoGroupChange();
368+
369+
/**
370+
* Set disable auto group change flag.
371+
*
372+
* @api
373+
* @param int $disableAutoGroupChange
374+
* @return $this
375+
*/
376+
public function setDisableAutoGroupChange($disableAutoGroupChange);
377+
360378
/**
361379
* Retrieve existing extension attributes object or create a new one.
362380
*

app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ protected function _extractCustomerData()
4545
}
4646

4747
if (isset($customerData['disable_auto_group_change'])) {
48-
$customerData['disable_auto_group_change'] = (int)$customerData['disable_auto_group_change'];
48+
$customerData['disable_auto_group_change'] = (int) filter_var(
49+
$customerData['disable_auto_group_change'],
50+
FILTER_VALIDATE_BOOLEAN
51+
);
4952
}
5053

5154
return $customerData;

app/code/Magento/Customer/Model/Data/Customer.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,16 @@ public function getAddresses()
237237
return $this->_get(self::KEY_ADDRESSES);
238238
}
239239

240+
/**
241+
* Get disable auto group change flag.
242+
*
243+
* @return int|null
244+
*/
245+
public function getDisableAutoGroupChange()
246+
{
247+
return $this->_get(self::DISABLE_AUTO_GROUP_CHANGE);
248+
}
249+
240250
/**
241251
* Set customer id
242252
*
@@ -446,6 +456,17 @@ public function setAddresses(array $addresses = null)
446456
return $this->setData(self::KEY_ADDRESSES, $addresses);
447457
}
448458

459+
/**
460+
* Set disable auto group change flag.
461+
*
462+
* @param int $disableAutoGroupChange
463+
* @return $this
464+
*/
465+
public function setDisableAutoGroupChange($disableAutoGroupChange)
466+
{
467+
return $this->setData(self::DISABLE_AUTO_GROUP_CHANGE, $disableAutoGroupChange);
468+
}
469+
449470
/**
450471
* {@inheritdoc}
451472
*

0 commit comments

Comments
 (0)