Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BulkOperationsConfig.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
11 
13 {
14  const XML_PATH_ASYNC_ENABLED = 'cataloginventory/bulk_operations/async';
15  const XML_PATH_BATCH_SIZE = 'cataloginventory/bulk_operations/batch_size';
16 
20  private $scopeConfig;
21 
25  public function __construct(ScopeConfigInterface $scopeConfig)
26  {
27  $this->scopeConfig = $scopeConfig;
28  }
29 
33  public function isAsyncEnabled(): bool
34  {
35  return (bool) $this->scopeConfig->getValue(self::XML_PATH_ASYNC_ENABLED);
36  }
37 
41  public function getBatchSize(): int
42  {
43  return (int) max(1, (int) $this->scopeConfig->getValue(self::XML_PATH_BATCH_SIZE));
44  }
45 }