Config.php 768 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Event configuration model
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Framework\Event;
  9. use Magento\Framework\Event\Config\Data;
  10. class Config implements ConfigInterface
  11. {
  12. /**
  13. * Modules configuration model
  14. *
  15. * @var Data
  16. */
  17. protected $_dataContainer;
  18. /**
  19. * @param Data $dataContainer
  20. */
  21. public function __construct(Data $dataContainer)
  22. {
  23. $this->_dataContainer = $dataContainer;
  24. }
  25. /**
  26. * Get observers by event name
  27. *
  28. * @param string $eventName
  29. * @return null|array|mixed
  30. */
  31. public function getObservers($eventName)
  32. {
  33. return $this->_dataContainer->get($eventName, []);
  34. }
  35. }