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-integration
Model
Oauth
Consumer
Validator
KeyLength.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Integration\Model\Oauth\Consumer\Validator
;
7
11
class
KeyLength
extends
\Zend_Validate_StringLength
12
{
18
protected
$_name
=
'Key'
;
19
23
protected
$_messageTemplates
= [
24
self::INVALID =>
"Invalid type given for %name%. String expected"
,
25
self::TOO_SHORT =>
"%name% '%value%' is less than %min% characters long"
,
26
self::TOO_LONG =>
"%name% '%value%' is more than %max% characters long"
,
27
];
28
34
protected
$_messageVariables
= [
'min'
=>
'_min'
,
'max'
=>
'_max'
,
'name'
=>
'_name'
];
35
44
public
function
__construct
(
$options
= [])
45
{
46
if
(!is_array(
$options
)) {
47
$options
= func_get_args();
48
if
(!isset(
$options
[1])) {
49
$options
[1] =
'utf-8'
;
50
}
51
parent::__construct(
$options
[0],
$options
[0],
$options
[1]);
52
return
;
53
}
else
{
54
if
(isset(
$options
[
'length'
])) {
55
$options
[
'max'
] =
$options
[
'min'
] =
$options
[
'length'
];
56
}
57
if
(isset(
$options
[
'name'
])) {
58
$this->_name =
$options
[
'name'
];
59
}
60
}
61
parent::__construct(
$options
);
62
}
63
70
public
function
setLength
($length)
71
{
72
parent::setMax($length);
73
parent::setMin($length);
74
return
$this;
75
}
76
82
public
function
getLength
()
83
{
84
return
parent::getMin();
85
}
86
97
public
function
isValid
(
$value
)
98
{
99
$result
= parent::isValid(
$value
);
100
if
(!
$result
&& isset($this->_messages[self::INVALID])) {
101
throw
new \Exception($this->_messages[self::INVALID]);
102
}
103
return
$result
;
104
}
105
112
public
function
setName
(
$name
)
113
{
114
$this->_name =
$name
;
115
return
$this;
116
}
117
123
public
function
getName
()
124
{
125
return
$this->_name
;
126
}
127
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength\isValid
isValid($value)
Definition:
KeyLength.php:97
Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength\$_name
$_name
Definition:
KeyLength.php:18
Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength\$_messageVariables
$_messageVariables
Definition:
KeyLength.php:34
Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength\getLength
getLength()
Definition:
KeyLength.php:82
Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength\setName
setName($name)
Definition:
KeyLength.php:112
Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength
Definition:
KeyLength.php:11
Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength\__construct
__construct($options=[])
Definition:
KeyLength.php:44
Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength\setLength
setLength($length)
Definition:
KeyLength.php:70
$value
$value
Definition:
gender.phtml:16
Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength\$_messageTemplates
$_messageTemplates
Definition:
KeyLength.php:23
Magento\Integration\Model\Oauth\Consumer\Validator\KeyLength\getName
getName()
Definition:
KeyLength.php:123
Magento\Integration\Model\Oauth\Consumer\Validator
Definition:
KeyLength.php:6
Zend_Validate_StringLength
Definition:
StringLength.php:33
$options
$options
Definition:
multiple_mixed_products.php:29
$name
if(!isset($_GET['name'])) $name
Definition:
log.php:14