45 AddressHelper $addressHelper,
54 $this->_isScopePrivate =
true;
65 $this->
setTemplate(
'Magento_Customer::widget/name.phtml');
86 return $this->_isAttributeVisible(
'prefix');
96 return $this->_isAttributeRequired(
'prefix');
106 $prefixOptions = $this->options->getNamePrefixOptions();
108 if ($this->getObject() && !empty($prefixOptions)) {
109 $prefixOption = $this->getObject()->getPrefix();
110 $oldPrefix = $this->
escapeHtml(trim($prefixOption));
111 if ($prefixOption !==
null && !isset($prefixOptions[$oldPrefix]) && !isset($prefixOptions[$prefixOption])) {
112 $prefixOptions[$oldPrefix] = $oldPrefix;
115 return $prefixOptions;
125 return $this->_isAttributeVisible(
'middlename');
135 return $this->_isAttributeRequired(
'middlename');
145 return $this->_isAttributeVisible(
'suffix');
155 return $this->_isAttributeRequired(
'suffix');
165 $suffixOptions = $this->options->getNameSuffixOptions();
166 if ($this->getObject() && !empty($suffixOptions)) {
167 $suffixOption = $this->getObject()->getSuffix();
168 $oldSuffix = $this->
escapeHtml(trim($suffixOption));
169 if ($suffixOption !==
null && !isset($suffixOptions[$oldSuffix]) && !isset($suffixOptions[$suffixOption])) {
170 $suffixOptions[$oldSuffix] = $oldSuffix;
173 return $suffixOptions;
183 if (!$this->
hasData(
'class_name')) {
184 $this->
setData(
'class_name',
'customer-name');
186 return $this->
getData(
'class_name');
208 if ($this->getForceUseCustomerAttributes() || $this->getObject() instanceof
CustomerInterface) {
214 }
catch (\
Magento\Framework\Exception\NoSuchEntityException $e) {
218 if ($this->getForceUseCustomerRequiredAttributes() &&
$attribute && !
$attribute->isRequired()) {
220 if ($customerAttribute && $customerAttribute->isRequired()) {
248 return $this->_addressHelper->getAttributeValidationClass(
$attributeCode);
258 return $attributeMetadata ? (bool)$attributeMetadata->isRequired() :
false;
268 return $attributeMetadata ? (bool)$attributeMetadata->isVisible() :
false;
getData($key='', $index=null)
escapeHtml($data, $allowedTags=null)
$_option $_optionId $class
setData($key, $value=null)