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-sitemap
Model
ItemProvider
CmsPage.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Sitemap\Model\ItemProvider
;
8
9
use Magento\Sitemap\Model\ResourceModel\Cms\PageFactory;
10
use Magento\Sitemap\Model\SitemapItemInterfaceFactory;
11
12
class
CmsPage
implements
ItemProviderInterface
13
{
19
private
$cmsPageFactory;
20
26
private
$itemFactory;
27
33
private
$configReader;
34
42
public
function
__construct
(
43
ConfigReaderInterface
$configReader,
44
PageFactory $cmsPageFactory,
45
SitemapItemInterfaceFactory $itemFactory
46
) {
47
$this->cmsPageFactory = $cmsPageFactory;
48
$this->itemFactory =
$itemFactory
;
49
$this->configReader = $configReader;
50
}
51
55
public
function
getItems
(
$storeId
)
56
{
57
$collection
= $this->cmsPageFactory->create()->getCollection(
$storeId
);
58
$items
= array_map(
function
(
$item
) use (
$storeId
) {
59
return
$this->itemFactory->create([
60
'url'
=>
$item
->getUrl(),
61
'updatedAt'
=>
$item
->getUpdatedAt(),
62
'images'
=>
$item
->getImages(),
63
'priority'
=> $this->configReader->getPriority(
$storeId
),
64
'changeFrequency'
=> $this->configReader->getChangeFrequency(
$storeId
),
65
]);
66
},
$collection
);
67
68
return
$items
;
69
}
70
}
$storeId
$storeId
Definition:
customer_review_with_rating.php:14
Magento\Sitemap\Model\ItemProvider
Definition:
CategoryConfigReaderTest.php:7
Magento\Sitemap\Model\ItemProvider\CmsPage\__construct
__construct(ConfigReaderInterface $configReader, PageFactory $cmsPageFactory, SitemapItemInterfaceFactory $itemFactory)
Definition:
CmsPage.php:42
$item
$item
Definition:
partial_invoice.php:27
Magento\Sitemap\Model\ItemProvider\ItemProviderInterface
Definition:
ItemProviderInterface.php:15
Magento\Sitemap\Model\ItemProvider\ConfigReaderInterface
Definition:
ConfigReaderInterface.php:14
Magento\Cms\Model\Page
Definition:
DataProvider.php:6
$itemFactory
$itemFactory
Definition:
invoice_with_bundle.php:30
Magento\Sitemap\Model\ItemProvider\CmsPage\getItems
getItems($storeId)
Definition:
CmsPage.php:55
$collection
$collection
Definition:
catalog_category_with_apostrophe_rollback.php:17
$items
$items
Definition:
order_rollback.php:21