Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
All Data Structures Namespaces Files Functions Variables Pages
MySQLSearchDeprecationNotification.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
17 {
21  private $searchEngineResolver;
22 
26  private $notifier;
27 
28  public function __construct(
29  \Magento\Framework\Search\EngineResolverInterface $searchEngineResolver,
30  \Magento\Framework\Notification\NotifierInterface $notifier
31  ) {
32  $this->searchEngineResolver = $searchEngineResolver;
33  $this->notifier = $notifier;
34  }
35 
39  public function apply()
40  {
41  if ($this->searchEngineResolver->getCurrentSearchEngine() === 'mysql') {
42  $message = <<<MESSAGE
43 Catalog Search is currently configured to use the MySQL engine, which has been deprecated. Consider migrating to one of
44 the Elasticsearch engines now to ensure there are no service interruptions during your next upgrade.
45 MESSAGE;
46 
47  $this->notifier->addNotice(__('Deprecation Notice'), __($message));
48  }
49  }
50 
54  public function getAliases()
55  {
56  return [];
57  }
58 
62  public static function getDependencies()
63  {
64  return [];
65  }
66 }
__()
Definition: __.php:13
$message
__construct(\Magento\Framework\Search\EngineResolverInterface $searchEngineResolver, \Magento\Framework\Notification\NotifierInterface $notifier)