Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConcealInProductionWithoutScdOnDemand.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
13 
24 {
28  private $concealInProduction;
29 
33  private $deploymentConfig;
34 
41  public function __construct(
42  ConcealInProductionFactory $concealInProductionFactory,
43  DeploymentConfig $deploymentConfig,
44  array $configs = [],
45  array $exemptions = []
46  ) {
47  $this->concealInProduction = $concealInProductionFactory
48  ->create(['configs' => $configs, 'exemptions' => $exemptions]);
49  $this->deploymentConfig = $deploymentConfig;
50  }
51 
56  public function isHidden($path): bool
57  {
58  if (!$this->deploymentConfig->getConfigData(Constants::CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION)) {
59  return $this->concealInProduction->isHidden($path);
60  }
61  return false;
62  }
63 
68  public function isDisabled($path): bool
69  {
70  if (!$this->deploymentConfig->getConfigData(Constants::CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION)) {
71  return $this->concealInProduction->isDisabled($path);
72  }
73  return false;
74  }
75 }
$deploymentConfig
__construct(ConcealInProductionFactory $concealInProductionFactory, DeploymentConfig $deploymentConfig, array $configs=[], array $exemptions=[])