Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SitemapConfigReader.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Sitemap\Model;
8 
11 
13 {
17  const XML_PATH_SITEMAP_VALID_PATHS = 'sitemap/file/valid_paths';
18 
22  const XML_PATH_PUBLIC_FILES_VALID_PATHS = 'general/file/public_files_valid_paths';
23 
27  const XML_PATH_MAX_LINES = 'sitemap/limit/max_lines';
28  const XML_PATH_MAX_FILE_SIZE = 'sitemap/limit/max_file_size';
34  const XML_PATH_SUBMISSION_ROBOTS = 'sitemap/search_engines/submission_robots';
35 
39  const XML_PATH_PRODUCT_IMAGES_INCLUDE = 'sitemap/product/image_include';
40 
46  private $scopeConfig;
47 
53  public function __construct(ScopeConfigInterface $scopeConfig)
54  {
55  $this->scopeConfig = $scopeConfig;
56  }
57 
62  {
63  return $this->scopeConfig->getValue(
64  self::XML_PATH_SUBMISSION_ROBOTS,
66  $storeId
67  );
68  }
69 
73  public function getMaximumFileSize($storeId)
74  {
75  return $this->scopeConfig->getValue(
76  self::XML_PATH_MAX_FILE_SIZE,
78  $storeId
79  );
80  }
81 
86  {
87  return $this->scopeConfig->getValue(
88  self::XML_PATH_MAX_LINES,
90  $storeId
91  );
92  }
93 
98  {
99  return (string)$this->scopeConfig->getValue(
100  self::XML_PATH_PRODUCT_IMAGES_INCLUDE,
102  $storeId
103  );
104  }
105 
109  public function getValidPaths()
110  {
111  return array_merge(
112  $this->scopeConfig->getValue(self::XML_PATH_SITEMAP_VALID_PATHS, ScopeInterface::SCOPE_STORE),
113  $this->scopeConfig->getValue(self::XML_PATH_PUBLIC_FILES_VALID_PATHS, ScopeInterface::SCOPE_STORE)
114  );
115  }
116 }
__construct(ScopeConfigInterface $scopeConfig)