ActionFactory.php 825 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Rule\Model;
  7. /**
  8. * @api
  9. * @since 100.0.2
  10. */
  11. class ActionFactory
  12. {
  13. /**
  14. * @var \Magento\Framework\ObjectManagerInterface
  15. */
  16. protected $_objectManager;
  17. /**
  18. * @param \Magento\Framework\ObjectManagerInterface $objectManager
  19. */
  20. public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager)
  21. {
  22. $this->_objectManager = $objectManager;
  23. }
  24. /**
  25. * Create new action object
  26. *
  27. * @param string $type
  28. * @param array $data
  29. * @return \Magento\Rule\Model\Action\ActionInterface
  30. */
  31. public function create($type, array $data = [])
  32. {
  33. return $this->_objectManager->create($type, $data);
  34. }
  35. }