Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Indexer Class Reference
Inheritance diagram for Indexer:
AppInterface

Public Member Functions

 __construct ( $reportDir, \Magento\Framework\Filesystem $filesystem, \Magento\Indexer\Model\Processor $processor, \Magento\Framework\App\Console\Response $response)
 
 launch ()
 
 catchException (App\Bootstrap $bootstrap, \Exception $exception)
 
- Public Member Functions inherited from AppInterface
 catchException (App\Bootstrap $bootstrap, \Exception $exception)
 

Protected Attributes

 $reportDir
 
 $filesystem
 
 $_response
 

Additional Inherited Members

- Data Fields inherited from AppInterface
const DISTRO_LOCALE_CODE = 'en_US'
 

Detailed Description

Definition at line 11 of file Indexer.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $reportDir,
\Magento\Framework\Filesystem  $filesystem,
\Magento\Indexer\Model\Processor  $processor,
\Magento\Framework\App\Console\Response  $response 
)
Parameters
string$reportDir
\Magento\Framework\Filesystem$filesystem
\Magento\Indexer\Model\Processor$processor
\Magento\Framework\App\Console\Response$response

Definition at line 36 of file Indexer.php.

41  {
42  $this->reportDir = $reportDir;
43  $this->filesystem = $filesystem;
44  $this->processor = $processor;
45  $this->_response = $response;
46  }
$response
Definition: 404.php:11
$processor
Definition: 404.php:10

Member Function Documentation

◆ catchException()

catchException ( App\Bootstrap  $bootstrap,
\Exception  $exception 
)

{}

Definition at line 72 of file Indexer.php.

73  {
74  return false;
75  }

◆ launch()

launch ( )

Run application

Returns
\Magento\Framework\App\ResponseInterface

Implements AppInterface.

Definition at line 53 of file Indexer.php.

54  {
55  /* Clean reports */
56  $directory = $this->filesystem->getDirectoryWrite(DirectoryList::ROOT);
57  $path = $directory->getRelativePath($this->reportDir);
58  if ($directory->isExist($path)) {
59  $directory->delete($path);
60  }
61 
62  /* Regenerate all indexers */
63  $this->processor->reindexAll();
64  $this->_response->setCode(0);
65 
66  return $this->_response;
67  }

Field Documentation

◆ $_response

$_response
protected

Definition at line 28 of file Indexer.php.

◆ $filesystem

$filesystem
protected

Definition at line 23 of file Indexer.php.

◆ $reportDir

$reportDir
protected

Definition at line 18 of file Indexer.php.


The documentation for this class was generated from the following file: