Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Config.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
14 {
15  const XML_PATH_IMAGE_ADAPTER = 'dev/image/default_adapter';
16 
17  const XML_PATH_IMAGE_ADAPTERS = 'dev/image/adapters';
18 
19  const XML_PATH_MAX_WIDTH_IMAGE = 'system/upload_configuration/max_width';
20 
21  const XML_PATH_MAX_HEIGHT_IMAGE = 'system/upload_configuration/max_height';
22 
26  protected $config;
27 
31  public function __construct(\Magento\Framework\App\Config\ScopeConfigInterface $config)
32  {
33  $this->config = $config;
34  }
35 
41  public function getAdapterAlias()
42  {
43  return (string)$this->config->getValue(self::XML_PATH_IMAGE_ADAPTER);
44  }
45 
51  public function getAdapters()
52  {
53  return $this->config->getValue(self::XML_PATH_IMAGE_ADAPTERS);
54  }
55 
61  public function getMaxWidth(): int
62  {
63  return (int)$this->config->getValue(self::XML_PATH_MAX_WIDTH_IMAGE);
64  }
65 
71  public function getMaxHeight(): int
72  {
73  return (int)$this->config->getValue(self::XML_PATH_MAX_HEIGHT_IMAGE);
74  }
75 }
__construct(\Magento\Framework\App\Config\ScopeConfigInterface $config)
Definition: Config.php:31