BaseFactory.php 889 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Base config model factory
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Framework\App\Config;
  9. class BaseFactory
  10. {
  11. /**
  12. * @var \Magento\Framework\ObjectManagerInterface
  13. */
  14. protected $_objectManager;
  15. /**
  16. * @param \Magento\Framework\ObjectManagerInterface $objectManager
  17. */
  18. public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager)
  19. {
  20. $this->_objectManager = $objectManager;
  21. }
  22. /**
  23. * Create config model
  24. *
  25. * @param string|\Magento\Framework\Simplexml\Element $sourceData
  26. * @return \Magento\Framework\App\Config\Base
  27. */
  28. public function create($sourceData = null)
  29. {
  30. return $this->_objectManager->create(\Magento\Framework\App\Config\Base::class, ['sourceData' => $sourceData]);
  31. }
  32. }