CarrierFactoryInterface.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Shipping\Model;
  7. use Magento\Shipping\Model\Carrier\AbstractCarrierInterface;
  8. /**
  9. * Interface CarrierFactoryInterface
  10. */
  11. interface CarrierFactoryInterface
  12. {
  13. /**
  14. * Get carrier instance
  15. *
  16. * @param string $carrierCode
  17. * @return bool|AbstractCarrierInterface
  18. * @api
  19. */
  20. public function get($carrierCode);
  21. /**
  22. * Create carrier instance
  23. *
  24. * @param string $carrierCode
  25. * @param int|null $storeId
  26. * @return bool|AbstractCarrierInterface
  27. * @api
  28. */
  29. public function create($carrierCode, $storeId = null);
  30. /**
  31. * Get carrier by its code if it is active
  32. *
  33. * @param string $carrierCode
  34. * @return bool|AbstractCarrierInterface
  35. * @api
  36. */
  37. public function getIfActive($carrierCode);
  38. /**
  39. * Create carrier by its code if it is active
  40. *
  41. * @param string $carrierCode
  42. * @param null|int $storeId
  43. * @return bool|AbstractCarrierInterface
  44. * @api
  45. */
  46. public function createIfActive($carrierCode, $storeId = null);
  47. }