/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/Data/Collection/EntityFactory.php
44 строки
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 2015 Adobe * All Rights Reserved. */ namespace Magento\Framework\Data\Collection; class EntityFactory implements EntityFactoryInterface { /** * Object Manager instance * * @var \Magento\Framework\ObjectManagerInterface */ protected $_objectManager = null; /** * Factory constructor * * @param \Magento\Framework\ObjectManagerInterface $objectManager */ public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager) { $this->_objectManager = $objectManager; } /** * Create class instance with specified parameters * * @param string $className * @param array $data * @throws \LogicException * @return \Magento\Framework\DataObject */ public function create($className, array $data = []) { $model = $this->_objectManager->create($className, $data); //TODO: fix that when this factory used only for \Magento\Framework\Model\AbstractModel //if (!$model instanceof \Magento\Framework\Model\AbstractModel) { // throw new \LogicException($className . ' doesn\'t implement \Magento\Framework\Model\AbstractModel'); //} return $model; } }