本文整理汇总了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;
}
示例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;
}
示例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) {
}
}
示例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;
}
示例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;
}
示例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;
}
示例7: _loadItems
/**
* Load stored items
*
* @return void
*/
protected function _loadItems()
{
if (is_null($this->_items)) {
$this->_items = (array) $this->_backendSession->getData($this->_getStorageKey());
}
}
示例8: getPopups
public function getPopups($clear = false)
{
return $this->session->getData(self::GROUP_ID, $clear);
}