Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-customer
Model
Attribute
Backend
Data
Boolean.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Customer\Model\Attribute\Backend\Data
;
7
13
class
Boolean
extends
\Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend
14
{
21
public
function
beforeSave
(
$customer
)
22
{
23
$attributeName = $this->
getAttribute
()->getName();
24
$inputValue =
$customer
->getData($attributeName);
25
$inputValue = $inputValue ===
null
? $this->
getAttribute
()->getDefaultValue() : $inputValue;
26
$sanitizedValue = !empty($inputValue) ?
'1'
:
'0'
;
27
$customer
->setData($attributeName, $sanitizedValue);
28
return
$this;
29
}
30
}
Magento\Customer\Model\Attribute\Backend\Data
Definition:
Boolean.php:6
Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend\getAttribute
getAttribute()
Definition:
AbstractBackend.php:81
$customer
$customer
Definition:
customers.php:11
Magento\Customer\Model\Attribute\Backend\Data\Boolean\beforeSave
beforeSave($customer)
Definition:
Boolean.php:21
Magento\Customer\Model\Attribute\Backend\Data\Boolean
Definition:
Boolean.php:13