ProviderFactory.php 727 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Analytics\Model;
  7. use Magento\Framework\ObjectManagerInterface;
  8. /**
  9. * Factory for report providers
  10. */
  11. class ProviderFactory
  12. {
  13. /**
  14. * @var ObjectManagerInterface
  15. */
  16. private $objectManager;
  17. /**
  18. * @param ObjectManagerInterface $objectManager
  19. */
  20. public function __construct(
  21. ObjectManagerInterface $objectManager
  22. ) {
  23. $this->objectManager = $objectManager;
  24. }
  25. /**
  26. * @param string $providerName
  27. * @return object
  28. */
  29. public function create($providerName)
  30. {
  31. return $this->objectManager->get($providerName);
  32. }
  33. }