File tree Expand file tree Collapse file tree 4 files changed +29
-22
lines changed
Category/Attribute/Source
Theme/Model/PageLayout/Config Expand file tree Collapse file tree 4 files changed +29
-22
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,12 @@ class Layout extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
17
17
*/
18
18
protected $ pageLayoutBuilder ;
19
19
20
+ /**
21
+ * @inheritdoc
22
+ * @deprecated since the cache is now handled by \Magento\Theme\Model\PageLayout\Config\Builder::$configFiles
23
+ */
24
+ protected $ _options = null ;
25
+
20
26
/**
21
27
* @param \Magento\Framework\View\Model\PageLayout\Config\BuilderInterface $pageLayoutBuilder
22
28
*/
@@ -26,14 +32,14 @@ public function __construct(\Magento\Framework\View\Model\PageLayout\Config\Buil
26
32
}
27
33
28
34
/**
29
- * { @inheritdoc}
35
+ * @inheritdoc
30
36
*/
31
37
public function getAllOptions ()
32
38
{
33
- if (! $ this ->_options ) {
34
- $ this -> _options = $ this -> pageLayoutBuilder -> getPageLayoutsConfig ()-> toOptionArray ( );
35
- array_unshift ( $ this ->_options , [ ' value ' => '' , ' label ' => __ ( ' No layout updates ' )]) ;
36
- }
37
- return $ this -> _options ;
39
+ $ options = $ this ->pageLayoutBuilder -> getPageLayoutsConfig ()-> toOptionArray ();
40
+ array_unshift ( $ options , [ ' value ' => '' , ' label ' => __ ( ' No layout updates ' )] );
41
+ $ this ->_options = $ options ;
42
+
43
+ return $ options ;
38
44
}
39
45
}
Original file line number Diff line number Diff line change @@ -17,6 +17,12 @@ class Layout extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
17
17
*/
18
18
protected $ pageLayoutBuilder ;
19
19
20
+ /**
21
+ * @inheritdoc
22
+ * @deprecated since the cache is now handled by \Magento\Theme\Model\PageLayout\Config\Builder::$configFiles
23
+ */
24
+ protected $ _options = null ;
25
+
20
26
/**
21
27
* @param \Magento\Framework\View\Model\PageLayout\Config\BuilderInterface $pageLayoutBuilder
22
28
*/
@@ -26,14 +32,14 @@ public function __construct(\Magento\Framework\View\Model\PageLayout\Config\Buil
26
32
}
27
33
28
34
/**
29
- * @return array
35
+ * @inheritdoc
30
36
*/
31
37
public function getAllOptions ()
32
38
{
33
- if (! $ this ->_options ) {
34
- $ this -> _options = $ this -> pageLayoutBuilder -> getPageLayoutsConfig ()-> toOptionArray ( );
35
- array_unshift ( $ this ->_options , [ ' value ' => '' , ' label ' => __ ( ' No layout updates ' )]) ;
36
- }
37
- return $ this -> _options ;
39
+ $ options = $ this ->pageLayoutBuilder -> getPageLayoutsConfig ()-> toOptionArray ();
40
+ array_unshift ( $ options , [ ' value ' => '' , ' label ' => __ ( ' No layout updates ' )] );
41
+ $ this ->_options = $ options ;
42
+
43
+ return $ options ;
38
44
}
39
45
}
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ class PageLayout implements OptionSourceInterface
20
20
21
21
/**
22
22
* @var array
23
+ * @deprecated since the cache is now handled by \Magento\Theme\Model\PageLayout\Config\Builder::$configFiles
23
24
*/
24
25
protected $ options ;
25
26
@@ -34,16 +35,10 @@ public function __construct(BuilderInterface $pageLayoutBuilder)
34
35
}
35
36
36
37
/**
37
- * Get options
38
- *
39
- * @return array
38
+ * @inheritdoc
40
39
*/
41
40
public function toOptionArray ()
42
41
{
43
- if ($ this ->options !== null ) {
44
- return $ this ->options ;
45
- }
46
-
47
42
$ configOptions = $ this ->pageLayoutBuilder ->getPageLayoutsConfig ()->getOptions ();
48
43
$ options = [];
49
44
foreach ($ configOptions as $ key => $ value ) {
@@ -54,6 +49,6 @@ public function toOptionArray()
54
49
}
55
50
$ this ->options = $ options ;
56
51
57
- return $ this -> options ;
52
+ return $ options ;
58
53
}
59
54
}
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public function __construct(
49
49
}
50
50
51
51
/**
52
- * @return \Magento\Framework\View\PageLayout\Config
52
+ * @inheritdoc
53
53
*/
54
54
public function getPageLayoutsConfig ()
55
55
{
@@ -61,7 +61,7 @@ public function getPageLayoutsConfig()
61
61
*/
62
62
protected function getConfigFiles ()
63
63
{
64
- if (empty ( $ this ->configFiles ) ) {
64
+ if (! $ this ->configFiles ) {
65
65
$ configFiles = [];
66
66
foreach ($ this ->themeCollection ->loadRegisteredThemes () as $ theme ) {
67
67
$ configFiles [] = $ this ->fileCollector ->getFilesContent ($ theme , 'layouts.xml ' );
You can’t perform that action at this time.
0 commit comments