BatchProvider.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
  4. */
  5. namespace Temando\Shipping\Model;
  6. use Magento\Sales\Api\Data\OrderInterface;
  7. /**
  8. * Temando Batch Provider
  9. *
  10. * Registry for re-use of the same batch entity during one request cycle.
  11. *
  12. * @package Temando\Shipping\Model
  13. * @author Rhodri Davies <rhodri.davies@temando.com>
  14. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  15. * @link http://www.temando.com/
  16. */
  17. class BatchProvider implements BatchProviderInterface
  18. {
  19. /**
  20. * @var BatchInterface
  21. */
  22. private $batch;
  23. /**
  24. * @var OrderInterface[]
  25. */
  26. private $orders = [];
  27. /**
  28. * @return BatchInterface
  29. */
  30. public function getBatch()
  31. {
  32. return $this->batch;
  33. }
  34. /**
  35. * @param BatchInterface $batch
  36. * @return void
  37. */
  38. public function setBatch(BatchInterface $batch)
  39. {
  40. $this->batch = $batch;
  41. }
  42. /**
  43. * @return OrderInterface[]
  44. */
  45. public function getOrders()
  46. {
  47. return $this->orders;
  48. }
  49. /**
  50. * @param OrderInterface[] $orders
  51. * @return void
  52. */
  53. public function setOrders(array $orders)
  54. {
  55. $this->orders = $orders;
  56. }
  57. }