Robots.php 889 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Robots\Model;
  7. use Magento\Framework\App\Config\ScopeConfigInterface;
  8. use Magento\Store\Model\ScopeInterface;
  9. /**
  10. * Returns data for robots.txt file
  11. */
  12. class Robots
  13. {
  14. /**
  15. * @var ScopeConfigInterface
  16. */
  17. private $scopeConfig;
  18. /**
  19. * @param ScopeConfigInterface $scopeConfig
  20. */
  21. public function __construct(
  22. ScopeConfigInterface $scopeConfig
  23. ) {
  24. $this->scopeConfig = $scopeConfig;
  25. }
  26. /**
  27. * Get the main data for robots.txt file as defined in configuration
  28. *
  29. * @return string
  30. */
  31. public function getData()
  32. {
  33. return $this->scopeConfig->getValue(
  34. 'design/search_engine_robots/custom_instructions',
  35. ScopeInterface::SCOPE_WEBSITE
  36. );
  37. }
  38. }