Collection.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Sales\Model\ResourceModel\Order\Invoice;
  7. use Magento\Sales\Api\Data\InvoiceSearchResultInterface;
  8. use Magento\Sales\Model\ResourceModel\Order\Collection\AbstractCollection;
  9. /**
  10. * Flat sales order invoice collection
  11. *
  12. * @api
  13. * @author Magento Core Team <core@magentocommerce.com>
  14. * @since 100.0.2
  15. */
  16. class Collection extends AbstractCollection implements InvoiceSearchResultInterface
  17. {
  18. /**
  19. * Id field name
  20. *
  21. * @var string
  22. */
  23. protected $_idFieldName = 'entity_id';
  24. /**
  25. * Event prefix
  26. *
  27. * @var string
  28. */
  29. protected $_eventPrefix = 'sales_order_invoice_collection';
  30. /**
  31. * Event object
  32. *
  33. * @var string
  34. */
  35. protected $_eventObject = 'order_invoice_collection';
  36. /**
  37. * Order field for setOrderFilter
  38. *
  39. * @var string
  40. */
  41. protected $_orderField = 'order_id';
  42. /**
  43. * Model initialization
  44. *
  45. * @return void
  46. */
  47. protected function _construct()
  48. {
  49. $this->_init(
  50. \Magento\Sales\Model\Order\Invoice::class,
  51. \Magento\Sales\Model\ResourceModel\Order\Invoice::class
  52. );
  53. }
  54. /**
  55. * Used to emulate after load functionality for each item without loading them
  56. *
  57. * @return void
  58. */
  59. protected function _afterLoad()
  60. {
  61. $this->walk('afterLoad');
  62. }
  63. }