/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/View/LayoutFactory.php
60 строк
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Copyright 2014 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\Framework\View; /** * Factory class for Layout * * @api */ class LayoutFactory { /** * Object Manager instance * * @var \Magento\Framework\ObjectManagerInterface */ protected $_objectManager; /** * Instance name to create * * @var string */ protected $_instanceName; /** * Constructor * * @param \Magento\Framework\ObjectManagerInterface $objectManager * @param string $instanceName */ public function __construct( \Magento\Framework\ObjectManagerInterface $objectManager, $instanceName = \Magento\Framework\View\LayoutInterface::class ) { $this->_objectManager = $objectManager; $this->_instanceName = $instanceName; } /** * Create class instance with specified parameters * * @param array $data * @return LayoutInterface * @throws \InvalidArgumentException */ public function create(array $data = []) { $layout = $this->_objectManager->create($this->_instanceName, $data); if (!$layout instanceof LayoutInterface) { throw new \InvalidArgumentException(get_class($layout) . ' must be an instance of LayoutInterface.'); } return $layout; } }