Collection.php 906 B

12345678910111213141516171819202122232425262728293031323334353637
  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\Tax;
  7. /**
  8. * Order Tax Collection
  9. *
  10. * @author Magento Core Team <core@magentocommerce.com>
  11. */
  12. class Collection extends \Magento\Sales\Model\ResourceModel\Collection\AbstractCollection
  13. {
  14. /**
  15. * Model initialization
  16. *
  17. * @return void
  18. */
  19. protected function _construct()
  20. {
  21. $this->_init(\Magento\Sales\Model\Order\Tax::class, \Magento\Sales\Model\ResourceModel\Order\Tax::class);
  22. }
  23. /**
  24. * Load by order
  25. *
  26. * @param \Magento\Sales\Model\Order $order
  27. * @return $this
  28. */
  29. public function loadByOrder($order)
  30. {
  31. $orderId = $order->getId();
  32. $this->getSelect()->where('main_table.order_id = ?', $orderId)->order('process');
  33. return $this->load();
  34. }
  35. }