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-catalog
Model
Product
Option
Type
File
ExistingValidate.php
Go to the documentation of this file.
1
<?php
7
declare(strict_types=1);
8
9
namespace
Magento\Catalog\Model\Product\Option\Type\File
;
10
14
class
ExistingValidate
extends
\Zend_Validate
15
{
22
public
function
isValid
(
$value
,
string
$originalName =
null
)
23
{
24
$this->_messages = [];
25
$this->_errors = [];
26
27
if
(!is_string(
$value
)) {
28
$this->_messages[] =
__
(
'Full file path is expected.'
)->render();
29
return
false
;
30
}
31
32
$result
=
true
;
33
$fileInfo
=
null
;
34
if
($originalName) {
35
$fileInfo
= [
'name'
=> $originalName];
36
}
37
foreach
($this->_validators as
$element
) {
38
$validator =
$element
[
'instance'
];
39
if
($validator->isValid(
$value
,
$fileInfo
)) {
40
continue
;
41
}
42
$result
=
false
;
43
$messages = $validator->getMessages();
44
$this->_messages = array_merge($this->_messages, $messages);
45
$this->_errors = array_merge($this->_errors, array_keys($messages));
46
if
(
$element
[
'breakChainOnFailure'
]) {
47
break
;
48
}
49
}
50
return
$result
;
51
}
52
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Catalog\Model\Product\Option\Type\File\ExistingValidate
Definition:
ExistingValidate.php:14
$fileInfo
$fileInfo
Definition:
create_link.php:16
__
__()
Definition:
__.php:13
$value
$value
Definition:
gender.phtml:16
Zend_Validate
Definition:
Validate.php:33
Magento\Catalog\Model\Product\Option\Type\File\ExistingValidate\isValid
isValid($value, string $originalName=null)
Definition:
ExistingValidate.php:22
Magento\Catalog\Model\Product\Option\Type\File
Definition:
ValidatorFileTest.php:7
$element
$element
Definition:
element.phtml:12