123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Sales\Model\Order\Email\Container;
- use Magento\Framework\App\Config\ScopeConfigInterface;
- use Magento\Store\Model\Store;
- use Magento\Store\Model\StoreManagerInterface;
- /**
- * Class Container
- *
- * @api
- * @since 100.0.2
- */
- abstract class Container implements IdentityInterface
- {
- /**
- * @var StoreManagerInterface
- */
- protected $storeManager;
- /**
- * Core store config
- *
- * @var ScopeConfigInterface
- */
- protected $scopeConfig;
- /**
- * @var Store
- */
- protected $store;
- /**
- * @var string
- */
- protected $customerName;
- /**
- * @var string
- */
- protected $customerEmail;
- /**
- * @param ScopeConfigInterface $scopeConfig
- * @param StoreManagerInterface $storeManager
- */
- public function __construct(
- ScopeConfigInterface $scopeConfig,
- StoreManagerInterface $storeManager
- ) {
- $this->scopeConfig = $scopeConfig;
- $this->storeManager = $storeManager;
- }
- /**
- * Return store configuration value
- *
- * @param string $path
- * @param int $storeId
- * @return mixed
- */
- protected function getConfigValue($path, $storeId)
- {
- return $this->scopeConfig->getValue(
- $path,
- \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
- $storeId
- );
- }
- /**
- * Set current store
- *
- * @param Store $store
- * @return void
- */
- public function setStore(Store $store)
- {
- $this->store = $store;
- }
- /**
- * Return store
- *
- * @return Store
- */
- public function getStore()
- {
- //current store
- if ($this->store instanceof Store) {
- return $this->store;
- }
- return $this->storeManager->getStore();
- }
- /**
- * Set customer name
- *
- * @param string $name
- * @return void
- */
- public function setCustomerName($name)
- {
- $this->customerName = $name;
- }
- /**
- * Set customer email
- *
- * @param string $email
- * @return void
- */
- public function setCustomerEmail($email)
- {
- $this->customerEmail = $email;
- }
- /**
- * Return customer name
- *
- * @return string
- */
- public function getCustomerName()
- {
- return $this->customerName;
- }
- /**
- * Return customer email
- *
- * @return string
- */
- public function getCustomerEmail()
- {
- return $this->customerEmail;
- }
- }
|