InitializeDefaultSourceForShipments.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. namespace Magento\InventoryShipping\Setup\Patch;
  8. use Magento\Framework\Setup\ModuleDataSetupInterface;
  9. use Magento\Framework\Setup\Patch\SchemaPatchInterface;
  10. use Magento\InventoryShipping\Setup\Operation\AssignDefaultSourceToShipments;
  11. /**
  12. * Initialize Default Source For Shipments
  13. */
  14. class InitializeDefaultSourceForShipments implements SchemaPatchInterface
  15. {
  16. /**
  17. * @var ModuleDataSetupInterface
  18. */
  19. private $moduleDataSetup;
  20. /**
  21. * @var AssignDefaultSourceToShipments
  22. */
  23. private $assignDefaultSourceToShipments;
  24. /**
  25. * @param ModuleDataSetupInterface $moduleDataSetup
  26. * @param AssignDefaultSourceToShipments $assignDefaultSourceToShipments
  27. */
  28. public function __construct(
  29. ModuleDataSetupInterface $moduleDataSetup,
  30. AssignDefaultSourceToShipments $assignDefaultSourceToShipments
  31. ) {
  32. $this->moduleDataSetup = $moduleDataSetup;
  33. $this->assignDefaultSourceToShipments = $assignDefaultSourceToShipments;
  34. }
  35. /**
  36. * @inheritDoc
  37. */
  38. public function apply()
  39. {
  40. $this->assignDefaultSourceToShipments->execute($this->moduleDataSetup);
  41. return $this;
  42. }
  43. /**
  44. * @inheritDoc
  45. */
  46. public static function getDependencies()
  47. {
  48. return [];
  49. }
  50. /**
  51. * @inheritDoc
  52. */
  53. public function getAliases()
  54. {
  55. return [];
  56. }
  57. }