Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-catalog
Controller
Adminhtml
Category
RefreshPath.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Catalog\Controller\Adminhtml\Category
;
8
9
use
Magento\Framework\App\Action\HttpGetActionInterface
as HttpGetActionInterface;
10
11
class
RefreshPath
extends
\Magento\Catalog\Controller\Adminhtml\Category
implements
HttpGetActionInterface
12
{
16
protected
$resultJsonFactory
;
17
22
public
function
__construct
(
23
\
Magento
\Backend\
App
\
Action
\
Context
$context,
24
\
Magento
\Framework\Controller\Result\JsonFactory
$resultJsonFactory
25
) {
26
parent::__construct($context);
27
$this->resultJsonFactory =
$resultJsonFactory
;
28
}
29
35
public
function
execute
()
36
{
37
$categoryId = (int)$this->
getRequest
()->getParam(
'id'
);
38
if
($categoryId) {
39
$category
= $this->_objectManager->create(\
Magento
\Catalog\Model\Category::class)->load($categoryId);
40
42
$resultJson = $this->resultJsonFactory->create();
43
return
$resultJson->setData([
44
'id'
=> $categoryId,
45
'path'
=>
$category
->getPath(),
46
'parentId'
=>
$category
->getParentId(),
47
]);
48
}
49
}
50
}
Magento\Catalog\Controller\Adminhtml\Category\RefreshPath\__construct
__construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory)
Definition:
RefreshPath.php:22
$category
$category
Definition:
catalog_category_with_slash.php:7
Magento\Framework\App
Magento\Catalog\Controller\Adminhtml\Category\RefreshPath
Definition:
RefreshPath.php:11
Magento\Framework\App\Action\HttpGetActionInterface
Definition:
HttpGetActionInterface.php:16
Magento\Catalog\Controller\Adminhtml\Category
Definition:
Add.php:7
Magento\Framework\App\Action\AbstractAction\getRequest
getRequest()
Definition:
AbstractAction.php:60
Magento\Framework\App\ActionInterface\execute
execute()
Magento\Backend\App\Action
Definition:
Action.php:17
Magento\Catalog\Controller\Adminhtml\Category
Definition:
Category.php:15
Magento
Magento\Backend\App\Action\Context
Definition:
Context.php:25
Magento\Catalog\Controller\Adminhtml\Category\RefreshPath\$resultJsonFactory
$resultJsonFactory
Definition:
RefreshPath.php:16