5
5
*/
6
6
namespace Magento \Catalog \Model \Product \Attribute \Source ;
7
7
8
- use Magento \Framework \App \Cache \Type \Layout as LayoutCache ;
9
- use Magento \Framework \App \ObjectManager ;
10
-
11
8
/**
12
9
* Catalog product landing page attribute source
10
+ *
11
+ * @author Magento Core Team <core@magentocommerce.com>
13
12
*/
14
13
class Layout extends \Magento \Eav \Model \Entity \Attribute \Source \AbstractSource
15
14
{
@@ -18,40 +17,22 @@ class Layout extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
18
17
*/
19
18
protected $ pageLayoutBuilder ;
20
19
21
- /**
22
- * @var LayoutCache
23
- */
24
- private $ layoutCache ;
25
-
26
20
/**
27
21
* @param \Magento\Framework\View\Model\PageLayout\Config\BuilderInterface $pageLayoutBuilder
28
- * @param LayoutCache|null $layoutCache
29
22
*/
30
- public function __construct (
31
- \Magento \Framework \View \Model \PageLayout \Config \BuilderInterface $ pageLayoutBuilder ,
32
- LayoutCache $ layoutCache = null
33
- ) {
23
+ public function __construct (\Magento \Framework \View \Model \PageLayout \Config \BuilderInterface $ pageLayoutBuilder )
24
+ {
34
25
$ this ->pageLayoutBuilder = $ pageLayoutBuilder ;
35
- $ this ->layoutCache = $ layoutCache ?? ObjectManager::getInstance ()->get (LayoutCache::class);
36
26
}
37
27
38
28
/**
39
- * Get list of available layouts
40
- *
41
29
* @return array
42
30
*/
43
31
public function getAllOptions ()
44
32
{
45
33
if (!$ this ->_options ) {
46
- $ layoutCacheKey = __CLASS__ ;
47
- if ($ data = $ this ->layoutCache ->load ($ layoutCacheKey )) {
48
- return $ this ->_options = unserialize ($ data );
49
- } else {
50
- $ this ->_options = $ this ->pageLayoutBuilder ->getPageLayoutsConfig ()->toOptionArray ();
51
- array_unshift ($ this ->_options , ['value ' => '' , 'label ' => __ ('No layout updates ' )]);
52
- $ this ->layoutCache ->save (serialize ($ this ->_options ), $ layoutCacheKey );
53
- }
54
-
34
+ $ this ->_options = $ this ->pageLayoutBuilder ->getPageLayoutsConfig ()->toOptionArray ();
35
+ array_unshift ($ this ->_options , ['value ' => '' , 'label ' => __ ('No layout updates ' )]);
55
36
}
56
37
return $ this ->_options ;
57
38
}
0 commit comments