Config.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Contact\Model;
  7. use Magento\Framework\App\Config\ScopeConfigInterface;
  8. use Magento\Store\Model\ScopeInterface;
  9. /**
  10. * Contact module configuration
  11. */
  12. class Config implements ConfigInterface
  13. {
  14. /**
  15. * @var ScopeConfigInterface
  16. */
  17. private $scopeConfig;
  18. /**
  19. * @param ScopeConfigInterface $scopeConfig
  20. */
  21. public function __construct(ScopeConfigInterface $scopeConfig)
  22. {
  23. $this->scopeConfig = $scopeConfig;
  24. }
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function isEnabled()
  29. {
  30. return $this->scopeConfig->isSetFlag(
  31. self::XML_PATH_ENABLED,
  32. ScopeInterface::SCOPE_STORE
  33. );
  34. }
  35. /**
  36. * {@inheritdoc}
  37. */
  38. public function emailTemplate()
  39. {
  40. return $this->scopeConfig->getValue(
  41. ConfigInterface::XML_PATH_EMAIL_TEMPLATE,
  42. ScopeInterface::SCOPE_STORE
  43. );
  44. }
  45. /**
  46. * {@inheritdoc}
  47. */
  48. public function emailSender()
  49. {
  50. return $this->scopeConfig->getValue(
  51. ConfigInterface::XML_PATH_EMAIL_SENDER,
  52. ScopeInterface::SCOPE_STORE
  53. );
  54. }
  55. /**
  56. * {@inheritdoc}
  57. */
  58. public function emailRecipient()
  59. {
  60. return $this->scopeConfig->getValue(
  61. ConfigInterface::XML_PATH_EMAIL_RECIPIENT,
  62. ScopeInterface::SCOPE_STORE
  63. );
  64. }
  65. }