CollectionFactory.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Reports\Model\ResourceModel\Quote;
  7. /**
  8. * Factory class for @see \Magento\Reports\Model\ResourceModel\Quote\Collection
  9. *
  10. * @codeCoverageIgnore
  11. */
  12. class CollectionFactory implements \Magento\Reports\Model\ResourceModel\Quote\CollectionFactoryInterface
  13. {
  14. /**
  15. * Object Manager instance
  16. *
  17. * @var \Magento\Framework\ObjectManagerInterface
  18. */
  19. protected $_objectManager = null;
  20. /**
  21. * Instance name to create
  22. *
  23. * @var string
  24. */
  25. protected $_instanceName = null;
  26. /**
  27. * Factory constructor
  28. *
  29. * @param \Magento\Framework\ObjectManagerInterface $objectManager
  30. * @param string $instanceName
  31. */
  32. public function __construct(
  33. \Magento\Framework\ObjectManagerInterface $objectManager,
  34. $instanceName = \Magento\Reports\Model\ResourceModel\Quote\Collection::class
  35. ) {
  36. $this->_objectManager = $objectManager;
  37. $this->_instanceName = $instanceName;
  38. }
  39. /**
  40. * {@inheritdoc)
  41. */
  42. public function create(array $data = [])
  43. {
  44. return $this->_objectManager->create($this->_instanceName, $data);
  45. }
  46. }