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


PHP SessionManagerInterface::getData方法代码示例

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


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

示例1: beforeGenerateXml

 /**
  * Before generate Xml
  *
  * @param \Magento\Framework\View\LayoutInterface $subject
  * @return array
  */
 public function beforeGenerateXml(\Magento\Framework\View\LayoutInterface $subject)
 {
     if ($this->depersonalizeChecker->checkIfDepersonalize($subject)) {
         $this->customerGroupId = $this->customerSession->getCustomerGroupId();
         $this->formKey = $this->session->getData(\Magento\Framework\Data\Form\FormKey::FORM_KEY);
     }
     return [];
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:14,代码来源:DepersonalizePlugin.php

示例2: testDestroy

 public function testDestroy()
 {
     $data = array('key' => 'value');
     $this->_model->setData($data);
     $this->assertEquals($data, $this->_model->getData());
     $this->_model->destroy();
     $this->assertEquals(array(), $this->_model->getData());
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:8,代码来源:SessionManagerTest.php

示例3: beforeGenerateXml

 /**
  * Before generate Xml
  *
  * @param \Magento\Framework\View\LayoutInterface $subject
  * @return array
  */
 public function beforeGenerateXml(\Magento\Framework\View\LayoutInterface $subject)
 {
     if ($this->moduleManager->isEnabled('Magento_PageCache') && $this->cacheConfig->isEnabled() && !$this->request->isAjax() && $subject->isCacheable()) {
         $this->customerGroupId = $this->customerSession->getCustomerGroupId();
         $this->formKey = $this->session->getData(\Magento\Framework\Data\Form\FormKey::FORM_KEY);
     }
     return array();
 }
开发者ID:aiesh,项目名称:magento2,代码行数:14,代码来源:DepersonalizePlugin.php

示例4: _getValidationState

 /**
  * Return validation state model
  *
  * @param string $cardType
  * @return \Magento\Centinel\Model\AbstractState
  */
 protected function _getValidationState($cardType = null)
 {
     $type = $cardType ? $cardType : $this->_centinelSession->getData('card_type');
     if (!$this->_validationState && $type) {
         $model = $this->_stateFactory->createState($type);
         if (!$model) {
             return false;
         }
         $model->setDataStorage($this->_centinelSession);
         $this->_validationState = $model;
     }
     return $this->_validationState;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:19,代码来源:Service.php

示例5: getWord

 /**
  * Get captcha word
  *
  * @return string
  */
 public function getWord()
 {
     $sessionData = $this->_session->getData($this->_getFormIdKey(self::SESSION_WORD));
     return time() < $sessionData['expires'] ? $sessionData['data'] : null;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:10,代码来源:DefaultModel.php

示例6: isPresent

 /**
  * @return bool
  */
 public function isPresent()
 {
     return (bool) $this->session->getData(self::FORM_KEY);
 }
开发者ID:vv-team,项目名称:foodo,代码行数:7,代码来源:FormKey.php

示例7: _partialAuthorization

 /**
  * Send request with new payment to gateway during partial authorization process
  *
  * @param \Magento\Payment\Model\Info $payment
  * @param float $amount
  * @param string $requestType
  * @return $this
  * @throws \Magento\Payment\Model\Info\Exception
  * @throws \Magento\Framework\Model\Exception
  */
 protected function _partialAuthorization($payment, $amount, $requestType)
 {
     $payment->setAnetTransType($requestType);
     /*
      * Try to build checksum of first request and compare with current checksum
      */
     if ($this->getConfigData('partial_authorization_checksum_checking')) {
         $payment->setAmount($amount);
         $firstPlacingRequest = $this->_buildRequest($payment);
         $newChecksum = $this->_generateChecksum($firstPlacingRequest, $this->_partialAuthorizationChecksumDataKeys);
         $previosChecksum = $this->_session->getData($this->_partialAuthorizationChecksumSessionKey);
         if ($newChecksum != $previosChecksum) {
             $quotePayment = $payment->getOrder()->getQuote()->getPayment();
             $this->cancelPartialAuthorization($payment);
             $this->_clearAssignedData($quotePayment);
             $this->setPartialAuthorizationLastActionState(self::PARTIAL_AUTH_DATA_CHANGED);
             $quotePayment->setAdditionalInformation($payment->getAdditionalInformation());
             throw new \Magento\Payment\Model\Info\Exception(__('The shopping cart contents and/or address has been changed.'));
         }
     }
     $amount = $amount - $this->getCardsStorage()->getProcessedAmount();
     if ($amount <= 0) {
         throw new \Magento\Framework\Model\Exception(__('This is an invalid amount for partial authorization.'));
     }
     $payment->setAmount($amount);
     $request = $this->_buildRequest($payment);
     $result = $this->_postRequest($request);
     $this->_processPartialAuthorizationResponse($result, $payment);
     switch ($requestType) {
         case self::REQUEST_TYPE_AUTH_ONLY:
             $newTransactionType = \Magento\Sales\Model\Order\Payment\Transaction::TYPE_AUTH;
             break;
         case self::REQUEST_TYPE_AUTH_CAPTURE:
             $newTransactionType = \Magento\Sales\Model\Order\Payment\Transaction::TYPE_CAPTURE;
             break;
     }
     foreach ($this->getCardsStorage()->getCards() as $card) {
         $this->_addTransaction($payment, $card->getLastTransId(), $newTransactionType, array('is_transaction_closed' => 0), array($this->_realTransactionIdKey => $card->getLastTransId()), $this->_authorizenetData->getTransactionMessage($payment, $requestType, $card->getLastTransId(), $card, $card->getProcessedAmount()));
         if ($requestType == self::REQUEST_TYPE_AUTH_CAPTURE) {
             $card->setCapturedAmount($card->getProcessedAmount());
             $this->getCardsStorage()->updateCard($card);
         }
     }
     $this->_session->setData($this->_partialAuthorizationChecksumSessionKey, null);
     return $this;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:56,代码来源:Authorizenet.php


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