CollectionUpdater.php 991 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Sales\Model\Grid\Child;
  7. class CollectionUpdater implements \Magento\Framework\View\Layout\Argument\UpdaterInterface
  8. {
  9. /**
  10. * @var \Magento\Framework\Registry
  11. */
  12. protected $registryManager;
  13. /**
  14. * @param \Magento\Framework\Registry $registryManager
  15. */
  16. public function __construct(
  17. \Magento\Framework\Registry $registryManager
  18. ) {
  19. $this->registryManager = $registryManager;
  20. }
  21. /**
  22. * Update grid collection according to chosen transaction
  23. *
  24. * @param \Magento\Sales\Model\ResourceModel\Transaction\Grid\Collection $argument
  25. * @return \Magento\Sales\Model\ResourceModel\Transaction\Grid\Collection
  26. */
  27. public function update($argument)
  28. {
  29. $argument->addParentIdFilter($this->registryManager->registry('current_transaction')->getId());
  30. return $argument;
  31. }
  32. }