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


PHP Session::getData方法代码示例

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


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

示例1: execute

 public function execute()
 {
     $id = $this->getRequest()->getParam('author_id');
     /** @var \Sample\News\Model\Author $author */
     $author = $this->initAuthor();
     /** @var \Magento\Backend\Model\View\Result\Page|\Magento\Framework\View\Result\Page $resultPage */
     $resultPage = $this->resultPageFactory->create();
     $resultPage->setActiveMenu('Sample_News::author');
     $resultPage->getConfig()->getTitle()->set(__('Authors'));
     if ($id) {
         $author->load($id);
         if (!$author->getId()) {
             $this->messageManager->addError(__('This author no longer exists.'));
             $resultRedirect = $this->resultRedirectFactory->create();
             $resultRedirect->setPath('sample_news/*/edit', ['author_id' => $author->getId(), '_current' => true]);
             return $resultRedirect;
         }
     }
     $title = $author->getId() ? $author->getName() : __('New Author');
     $resultPage->getConfig()->getTitle()->append($title);
     $data = $this->backendSession->getData('sample_news_author_data', true);
     if (!empty($data)) {
         $author->setData($data);
     }
     return $resultPage;
 }
开发者ID:nhc,项目名称:Magento2SampleModule,代码行数:26,代码来源:Edit.php

示例2: execute

 /**
  * @return \Magento\Backend\Model\View\Result\Page|\Magento\Backend\Model\View\Result\Redirect|\Magento\Framework\View\Result\Page
  */
 public function execute()
 {
     $id = $this->getRequest()->getParam('post_id');
     /** @var \Mageplaza\Blog\Model\Post $post */
     $post = $this->initPost();
     /** @var \Magento\Backend\Model\View\Result\Page|\Magento\Framework\View\Result\Page $resultPage */
     $resultPage = $this->resultPageFactory->create();
     $resultPage->setActiveMenu('Mageplaza_Blog::post');
     $resultPage->getConfig()->getTitle()->set(__('Posts'));
     if ($id) {
         $post->load($id);
         if (!$post->getId()) {
             $this->messageManager->addError(__('This Post no longer exists.'));
             $resultRedirect = $this->resultRedirectFactory->create();
             $resultRedirect->setPath('mageplaza_blog/*/edit', ['post_id' => $post->getId(), '_current' => true]);
             return $resultRedirect;
         }
     }
     $title = $post->getId() ? $post->getName() : __('New Post');
     $resultPage->getConfig()->getTitle()->prepend($title);
     $data = $this->backendSession->getData('mageplaza_blog_post_data', true);
     if (!empty($data)) {
         $post->setData($data);
     }
     return $resultPage;
 }
开发者ID:mageplaza,项目名称:magento-2-blog-extension,代码行数:29,代码来源:Edit.php

示例3: register

 /**
  * Register module
  *
  * @param        $module
  * @param        $version
  * @param string $type
  */
 public function register($module, $version, $type = 'install')
 {
     if (null === $module || null === $version) {
         return;
     }
     $sessionDataKey = 'is_registered_' . $module;
     if ($this->session->getData($sessionDataKey)) {
         return;
     }
     $curl = new \Magento\Framework\HTTP\Client\Curl();
     try {
         $curl->post(self::EXTENSION_REGISTER_URL, ['module' => $module, 'version' => $version, 'site_url' => $this->getAllUrls(), 'type' => $type]);
         $this->session->setData($sessionDataKey, true);
     } catch (Exception $e) {
     }
 }
开发者ID:eonsequeira,项目名称:HS_All,代码行数:23,代码来源:Data.php

示例4: execute

 /**
  * @return \Magento\Backend\Model\View\Result\Page|\Magento\Framework\View\Result\Page
  */
 public function execute()
 {
     $id = $this->getRequest()->getParam('article_id');
     $article = $this->initArticle();
     $resultPage = $this->resultPageFactory->create();
     $resultPage->setActiveMenu('Gemtoo_Blog::article');
     $resultPage->getConfig()->getTitle()->set(__('Articles'));
     if ($id) {
         $article->load($id);
         if (!$article->getId()) {
             $this->messageManager->addError(__('This article no longer exists.'));
             $resultRedirect = $this->resultRedirectFactory->create();
             $resultRedirect->setPath('gemtoo_blog/*/edit', ['article_id' => $article->getId(), '_current' => true]);
             return $resultRedirect;
         }
     }
     $title = $article->getId() ? $article->getName() : __('New Article');
     $resultPage->getConfig()->getTitle()->append($title);
     $data = $this->backendSession->getData('gemtoo_blog_article_data', true);
     if (!empty($data)) {
         $article->setData($data);
     }
     return $resultPage;
 }
开发者ID:pleminh,项目名称:Gemtoo,代码行数:27,代码来源:Edit.php

示例5: request

 /**
  * Get all transactions and orders and return builded data
  *
  * @return array
  */
 public function request()
 {
     //load payments by date
     $this->getPagSeguroAbandoned();
     if ($this->_PagSeguroPaymentList->getTransactions()) {
         foreach ($this->_PagSeguroPaymentList->getTransactions() as $payment) {
             date_default_timezone_set('UTC');
             $order = \UOL\PagSeguro\Helper\Data::getReferenceDecryptOrderID($payment->getReference());
             $order = $this->_order->load($order);
             if ($this->getStoreReference() == \UOL\PagSeguro\Helper\Data::getReferenceDecrypt($payment->getReference())) {
                 if (!is_null($this->_session->getData('store_id'))) {
                     array_push($this->_arrayPayments, $this->build($payment, $order));
                 }
                 if ($order) {
                     array_push($this->_arrayPayments, $this->build($payment, $order));
                 }
             }
         }
     }
     date_default_timezone_set($this->_timezone->getConfigTimezone());
     return $this->_arrayPayments;
 }
开发者ID:pagseguro,项目名称:magento2,代码行数:27,代码来源:Abandoned.php

示例6: getParam

 /**
  * Retrieve grid
  *
  * @param string $paramName
  * @param mixed $default
  * @return mixed
  */
 public function getParam($paramName, $default = null)
 {
     $sessionParamName = $this->getId() . $paramName;
     if ($this->getRequest()->has($paramName)) {
         $param = $this->getRequest()->getParam($paramName);
         if ($this->_saveParametersInSession) {
             $this->_backendSession->setData($sessionParamName, $param);
         }
         return $param;
     } elseif ($this->_saveParametersInSession && ($param = $this->_backendSession->getData($sessionParamName))) {
         return $param;
     }
     return $default;
 }
开发者ID:opexsw,项目名称:magento2,代码行数:21,代码来源:Grid.php

示例7: _loadItems

 /**
  * Load stored items
  *
  * @return void
  */
 protected function _loadItems()
 {
     if (is_null($this->_items)) {
         $this->_items = (array) $this->_backendSession->getData($this->_getStorageKey());
     }
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:11,代码来源:Pager.php

示例8: getPopups

 public function getPopups($clear = false)
 {
     return $this->session->getData(self::GROUP_ID, $clear);
 }
开发者ID:swissup,项目名称:core,代码行数:4,代码来源:PopupMessageManager.php


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