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-indexer
Model
Message
Invalid.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Indexer\Model\Message
;
8
9
class
Invalid
implements
\Magento\Framework\Notification\MessageInterface
10
{
14
protected
$collection
;
15
19
protected
$urlBuilder
;
20
25
public
function
__construct
(
26
\
Magento
\
Indexer
\Model\
Indexer
\Collection
$collection
,
27
\
Magento
\Framework\UrlInterface
$urlBuilder
28
) {
29
$this->collection =
$collection
;
30
$this->urlBuilder =
$urlBuilder
;
31
}
32
38
public
function
isDisplayed
()
39
{
41
foreach
($this->collection->getItems() as
$indexer
) {
42
if
(
$indexer
->getStatus() ==
\Magento\Framework\Indexer\StateInterface::STATUS_INVALID
) {
43
return
true
;
44
}
45
}
46
47
return
false
;
48
}
49
50
//@codeCoverageIgnoreStart
51
57
public
function
getIdentity
()
58
{
59
return
md5(
'INDEX_INVALID'
);
60
}
61
67
public
function
getText
()
68
{
69
$url
= $this->urlBuilder->getUrl(
'indexer/indexer/list'
);
70
//@codingStandardsIgnoreStart
71
return
__
(
72
'One or more <a href="%1">indexers are invalid</a>. Make sure your <a href="%2" target="_blank">Magento cron job</a> is running.'
,
73
$url
,
74
'http://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-cron.html#create-or-remove-the-magento-crontab'
75
);
76
//@codingStandardsIgnoreEnd
77
}
78
84
public
function
getSeverity
()
85
{
86
return
self::SEVERITY_MAJOR
;
87
}
88
89
//@codeCoverageIgnoreEnd
90
}
Magento\Indexer\Model\Message\Invalid\$urlBuilder
$urlBuilder
Definition:
Invalid.php:19
$url
$url
Definition:
query_redirect.php:14
Magento\Indexer\Model\Message\Invalid\$collection
$collection
Definition:
Invalid.php:14
Magento\Framework\Indexer\StateInterface\STATUS_INVALID
const STATUS_INVALID
Definition:
StateInterface.php:19
__
__()
Definition:
__.php:13
Magento\Indexer\Model\Message\Invalid\getSeverity
getSeverity()
Definition:
Invalid.php:84
Magento\Indexer\Model\Message
Definition:
Invalid.php:7
Magento\Framework\Notification\MessageInterface\isDisplayed
isDisplayed()
Magento\Framework\Notification\MessageInterface\SEVERITY_MAJOR
const SEVERITY_MAJOR
Definition:
MessageInterface.php:23
Magento\Indexer\Model\Message\Invalid\getText
getText()
Definition:
Invalid.php:67
Magento
Magento\Framework\Notification\MessageInterface
Definition:
MessageInterface.php:19
Magento\Indexer\Model\Indexer
Definition:
Indexer.php:19
Magento\Indexer\Model\Message\Invalid\getIdentity
getIdentity()
Definition:
Invalid.php:57
Magento\Indexer\Model\Message\Invalid
Definition:
Invalid.php:9
$indexer
$indexer
Definition:
product_different_store_prices.php:21
Magento\Indexer\Model\Message\Invalid\__construct
__construct(\Magento\Indexer\Model\Indexer\Collection $collection, \Magento\Framework\UrlInterface $urlBuilder)
Definition:
Invalid.php:25