5
5
*/
6
6
namespace Magento \Cms \Model \Config \Source ;
7
7
8
+ use Magento \Cms \Model \Resource \Page \CollectionFactory ;
9
+
8
10
/**
9
11
* Class Page
10
12
*/
@@ -16,25 +18,17 @@ class Page implements \Magento\Framework\Option\ArrayInterface
16
18
protected $ options ;
17
19
18
20
/**
19
- * @var \Magento\Cms\Model\PageRepository
20
- */
21
- protected $ pageRepository ;
22
-
23
- /**
24
- * @var \Magento\Framework\Api\SearchCriteriaBuilder
21
+ * @var CollectionFactory
25
22
*/
26
- protected $ pageCriteriaBuilder ;
23
+ protected $ collectionFactory ;
27
24
28
25
/**
29
- * @param \Magento\Cms\Model\PageRepository $pageRepository
30
- * @param \Magento\Framework\Api\SearchCriteriaBuilder $pageCriteriaBuilder
26
+ * @param CollectionFactory $collectionFactory
31
27
*/
32
28
public function __construct (
33
- \Magento \Cms \Model \PageRepository $ pageRepository ,
34
- \Magento \Framework \Api \SearchCriteriaBuilder $ pageCriteriaBuilder
29
+ CollectionFactory $ collectionFactory
35
30
) {
36
- $ this ->pageRepository = $ pageRepository ;
37
- $ this ->pageCriteriaBuilder = $ pageCriteriaBuilder ;
31
+ $ this ->collectionFactory = $ collectionFactory ;
38
32
}
39
33
40
34
/**
@@ -45,7 +39,7 @@ public function __construct(
45
39
public function toOptionArray ()
46
40
{
47
41
if (!$ this ->options ) {
48
- $ this ->options = $ this ->pageRepository -> getList ( $ this -> pageCriteriaBuilder -> create () )->toOptionIdArray ();
42
+ $ this ->options = $ this ->collectionFactory -> create ()->toOptionIdArray ();
49
43
}
50
44
return $ this ->options ;
51
45
}
0 commit comments