当前位置: 首页>>代码示例>>PHP>>正文


PHP Context::getAppState方法代码示例

本文整理汇总了PHP中Magento\Framework\Model\Context::getAppState方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::getAppState方法的具体用法?PHP Context::getAppState怎么用?PHP Context::getAppState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Framework\Model\Context的用法示例。


在下文中一共展示了Context::getAppState方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * @param \Magento\Payment\Model\CcConfig $ccConfig
  * @param PaymentHelper $paymentHelper
  * @param \Adyen\Payment\Helper\Data $adyenHelper
  */
 public function __construct(\Magento\Framework\Model\Context $context, \Magento\Payment\Model\CcConfig $ccConfig, PaymentHelper $paymentHelper, \Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Model\Resource\Billing\Agreement\CollectionFactory $billingAgreementCollectionFactory, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $session, \Magento\Store\Model\StoreManagerInterface $storeManager)
 {
     parent::__construct($ccConfig, $paymentHelper, $this->methodCodes);
     $this->_paymentHelper = $paymentHelper;
     $this->_adyenHelper = $adyenHelper;
     $this->_billingAgreementCollectionFactory = $billingAgreementCollectionFactory;
     $this->_customerSession = $customerSession;
     $this->_session = $session;
     $this->_appState = $context->getAppState();
     $this->_storeManager = $storeManager;
 }
开发者ID:pivulic,项目名称:adyen-magento2,代码行数:16,代码来源:AdyenOneclickConfigProvider.php

示例2: __construct

 /**
  * @param \Magento\Framework\Model\Context $context
  * @param \Magento\Checkout\Model\Session $session
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param PaymentHelper $paymentHelper
  * @param \Adyen\Payment\Helper\Data $adyenHelper
  */
 public function __construct(\Magento\Framework\Model\Context $context, \Magento\Checkout\Model\Session $session, \Magento\Store\Model\StoreManagerInterface $storeManager, PaymentHelper $paymentHelper, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Framework\App\Config\ScopeConfigInterface $config, \Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Logger\AdyenLogger $adyenLogger)
 {
     $this->_appState = $context->getAppState();
     $this->_session = $session;
     $this->_storeManager = $storeManager;
     $this->_paymentHelper = $paymentHelper;
     $this->_localeResolver = $localeResolver;
     $this->_config = $config;
     $this->_adyenHelper = $adyenHelper;
     $this->_adyenLogger = $adyenLogger;
     foreach ($this->methodCodes as $code) {
         $this->methods[$code] = $this->_paymentHelper->getMethodInstance($code);
     }
 }
开发者ID:pivulic,项目名称:adyen-magento2,代码行数:21,代码来源:AdyenHppConfigProvider.php

示例3: __construct

 /**
  * PaymentRequest constructor.
  *
  * @param \Magento\Framework\Model\Context $context
  * @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
  * @param \Adyen\Payment\Helper\Data $adyenHelper
  * @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
  * @param \Adyen\Payment\Model\RecurringType $recurringType
  * @param array $data
  */
 public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Encryption\EncryptorInterface $encryptor, \Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Logger\AdyenLogger $adyenLogger, \Adyen\Payment\Model\RecurringType $recurringType, array $data = [])
 {
     $this->_encryptor = $encryptor;
     $this->_adyenHelper = $adyenHelper;
     $this->_adyenLogger = $adyenLogger;
     $this->_recurringType = $recurringType;
     $this->_appState = $context->getAppState();
     // initialize client
     $webserviceUsername = $this->_adyenHelper->getWsUsername();
     $webservicePassword = $this->_adyenHelper->getWsPassword();
     $client = new \Adyen\Client();
     $client->setApplicationName("Magento 2 plugin");
     $client->setUsername($webserviceUsername);
     $client->setPassword($webservicePassword);
     if ($this->_adyenHelper->isDemoMode()) {
         $client->setEnvironment(\Adyen\Environment::TEST);
     } else {
         $client->setEnvironment(\Adyen\Environment::LIVE);
     }
     // assign magento log
     $client->setLogger($adyenLogger);
     $this->_client = $client;
 }
开发者ID:Adyen,项目名称:adyen-magento2,代码行数:33,代码来源:TransactionAuthorization.php

示例4: __construct

 /**
  * @param \Magento\Framework\Model\Context $context
  * @param \Magento\Framework\Registry $registry
  * @param \Magento\Framework\Model\Resource\AbstractResource $resource
  * @param \Magento\Framework\Data\Collection\Db $resourceCollection
  * @param array $data
  */
 public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\Resource\AbstractResource $resource = null, \Magento\Framework\Data\Collection\Db $resourceCollection = null, array $data = [])
 {
     $this->_registry = $registry;
     $this->_appState = $context->getAppState();
     $this->_eventManager = $context->getEventDispatcher();
     $this->_cacheManager = $context->getCacheManager();
     $this->_resource = $resource;
     $this->_resourceCollection = $resourceCollection;
     $this->_logger = $context->getLogger();
     $this->_actionValidator = $context->getActionValidator();
     if (method_exists($this->_resource, 'getIdFieldName') || $this->_resource instanceof \Magento\Framework\Object) {
         $this->_idFieldName = $this->_getResource()->getIdFieldName();
     }
     parent::__construct($data);
     $this->_construct();
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:23,代码来源:AbstractModel.php

示例5: __construct

 /**
  * RecurringDataBuilder constructor.
  *
  * @param \Adyen\Payment\Helper\Data $adyenHelper
  * @param \Magento\Framework\Model\Context $context
  */
 public function __construct(\Adyen\Payment\Helper\Data $adyenHelper, \Magento\Framework\Model\Context $context)
 {
     $this->adyenHelper = $adyenHelper;
     $this->appState = $context->getAppState();
 }
开发者ID:Adyen,项目名称:adyen-magento2,代码行数:11,代码来源:RecurringDataBuilder.php

示例6: __construct

 public function __construct(Context $context)
 {
     $this->isDeveloper = $context->getAppState()->getMode() == State::MODE_DEVELOPER;
 }
开发者ID:outeredge,项目名称:edge-magento-module-base,代码行数:4,代码来源:Data.php


注:本文中的Magento\Framework\Model\Context::getAppState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。