CollectionFactory.php 860 B

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