Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Invalid.php
Go to the documentation of this file.
1 <?php
8 
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) {
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 }
__()
Definition: __.php:13
__construct(\Magento\Indexer\Model\Indexer\Collection $collection, \Magento\Framework\UrlInterface $urlBuilder)
Definition: Invalid.php:25