Factory.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Factory class for \Magento\Framework\Authorization
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Framework\Authorization;
  9. use Magento\Framework\Authorization;
  10. use Magento\Framework\ObjectManagerInterface;
  11. class Factory
  12. {
  13. /**
  14. * Entity class name
  15. */
  16. const CLASS_NAME = \Magento\Framework\Authorization::class;
  17. /**
  18. * Object Manager instance
  19. *
  20. * @var ObjectManagerInterface
  21. */
  22. protected $_objectManager = null;
  23. /**
  24. * Factory constructor
  25. *
  26. * @param ObjectManagerInterface $objectManager
  27. */
  28. public function __construct(ObjectManagerInterface $objectManager)
  29. {
  30. $this->_objectManager = $objectManager;
  31. }
  32. /**
  33. * Create class instance with specified parameters
  34. *
  35. * @param array $data
  36. * @return Authorization
  37. */
  38. public function create(array $data = [])
  39. {
  40. return $this->_objectManager->create(self::CLASS_NAME, $data);
  41. }
  42. }