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)
Main Page
Related Pages
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
c
d
e
f
g
h
i
m
p
r
s
t
u
+
Functions
_
c
d
e
f
g
h
i
m
p
r
s
t
u
Variables
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
(
_
a
b
c
d
e
f
g
h
i
j
m
n
o
p
q
r
s
t
u
v
w
+
Functions
_
c
d
e
f
g
m
o
r
s
t
v
+
Variables
$
(
_
a
b
c
d
e
f
g
h
i
j
m
n
o
p
q
r
s
t
u
v
w
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
vendor
magento
module-customer
Ui
Component
Listing
Column
ValidationRules.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Customer\Ui\Component\Listing\Column
;
7
8
use
Magento\Customer\Api\Data\ValidationRuleInterface
;
9
10
class
ValidationRules
11
{
15
protected
$inputValidationMap
= [
16
'alpha'
=>
'validate-alpha'
,
17
'numeric'
=>
'validate-number'
,
18
'alphanumeric'
=>
'validate-alphanum'
,
19
'url'
=>
'validate-url'
,
20
'email'
=>
'validate-email'
,
21
];
22
30
public
function
getValidationRules($isRequired, $validationRules)
31
{
32
$rules
= [];
33
if
($isRequired) {
34
$rules
[
'required-entry'
] =
true
;
35
}
36
if
(empty($validationRules)) {
37
return
$rules
;
38
}
40
foreach
($validationRules as
$rule
) {
41
if
(!
$rule
instanceof
ValidationRuleInterface
) {
42
continue
;
43
}
44
$validationClass = $this->
getValidationClass
($rule);
45
if
($validationClass) {
46
$rules
[$validationClass] = $this->
getRuleValue
($rule);
47
}
48
}
49
50
return
$rules
;
51
}
52
59
protected
function
getValidationClass
(
ValidationRuleInterface
$rule
)
60
{
61
$key =
$rule
->getName() ==
'input_validation'
?
$rule
->getValue() :
$rule
->getName();
62
return
isset($this->inputValidationMap[$key])
63
? $this->inputValidationMap[$key]
64
: $key;
65
}
66
73
protected
function
getRuleValue
(
ValidationRuleInterface
$rule
)
74
{
75
return
$rule
->getName() !=
'input_validation'
?
$rule
->getValue() :
true
;
76
}
77
}
Magento\Customer\Ui\Component\Listing\Column
Definition:
AccountLock.php:6
$rule
$rule
Definition:
rule_by_attribute.php:10
$rules
$rules
Definition:
classmap_generator.php:59
Magento\Customer\Ui\Component\Listing\Column\ValidationRules\getRuleValue
getRuleValue(ValidationRuleInterface $rule)
Definition:
ValidationRules.php:73
Magento\Customer\Ui\Component\Listing\Column\ValidationRules
Definition:
ValidationRules.php:10
Magento\Customer\Api\Data\ValidationRuleInterface
Definition:
ValidationRuleInterface.php:15
Magento\Customer\Ui\Component\Listing\Column\ValidationRules\$inputValidationMap
$inputValidationMap
Definition:
ValidationRules.php:15
Magento\Customer\Ui\Component\Listing\Column\ValidationRules\getValidationClass
getValidationClass(ValidationRuleInterface $rule)
Definition:
ValidationRules.php:59