@@ -58,23 +58,6 @@ public function __construct(
58
58
$ this ->storeManager = $ storeManager ;
59
59
}
60
60
61
- /**
62
- * @deprecated
63
- * @see getDataByPageId(int $pageId)
64
- *
65
- * Get the page data
66
- *
67
- * @param int $pageId
68
- * @return array
69
- * @throws NoSuchEntityException
70
- */
71
- public function getData (int $ pageId ): array
72
- {
73
- $ page = $ this ->pageRepository ->getById ($ pageId );
74
-
75
- return $ this ->convertPageData ($ page );
76
- }
77
-
78
61
/**
79
62
* Returns page data by page_id
80
63
*
@@ -86,7 +69,7 @@ public function getDataByPageId(int $pageId): array
86
69
{
87
70
$ page = $ this ->pageRepository ->getById ($ pageId );
88
71
89
- return $ this ->convertPageData ($ page, false , true );
72
+ return $ this ->convertPageData ($ page );
90
73
}
91
74
92
75
/**
@@ -101,17 +84,15 @@ public function getDataByPageIdentifier(string $pageIdentifier): array
101
84
$ storeId = (int )$ this ->storeManager ->getStore ()->getId ();
102
85
$ page = $ this ->pageByIdentifier ->execute ($ pageIdentifier , $ storeId );
103
86
104
- return $ this ->convertPageData ($ page, false , true );
87
+ return $ this ->convertPageData ($ page );
105
88
}
106
89
107
90
/**
108
91
* @param PageInterface $page
109
- * @param bool $includePageId
110
- * @param bool $includePageIdentifier
111
92
* @return array
112
93
* @throws NoSuchEntityException
113
94
*/
114
- private function convertPageData (PageInterface $ page, $ includePageId = true , $ includePageIdentifier = false )
95
+ private function convertPageData (PageInterface $ page )
115
96
{
116
97
if (false === $ page ->isActive ()) {
117
98
throw new NoSuchEntityException ();
@@ -128,16 +109,9 @@ private function convertPageData(PageInterface $page, $includePageId = true, $in
128
109
PageInterface::META_TITLE => $ page ->getMetaTitle (),
129
110
PageInterface::META_DESCRIPTION => $ page ->getMetaDescription (),
130
111
PageInterface::META_KEYWORDS => $ page ->getMetaKeywords (),
112
+ PageInterface::PAGE_ID => $ page ->getId (),
113
+ PageInterface::IDENTIFIER => $ page ->getIdentifier (),
131
114
];
132
-
133
- if ($ includePageId ) {
134
- $ pageData [PageInterface::PAGE_ID ] = $ page ->getId ();
135
- }
136
-
137
- if ($ includePageIdentifier ) {
138
- $ pageData [PageInterface::IDENTIFIER ] = $ page ->getIdentifier ();
139
- }
140
-
141
115
return $ pageData ;
142
116
}
143
117
}
0 commit comments