StoreSwitcherInterface.php 857 B

1234567891011121314151617181920212223242526
  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\Store\Model;
  8. use Magento\Store\Api\Data\StoreInterface;
  9. use Magento\Store\Model\StoreSwitcher\CannotSwitchStoreException;
  10. /**
  11. * Handles store switching procedure and detects url for final redirect after store switching.
  12. */
  13. interface StoreSwitcherInterface
  14. {
  15. /**
  16. * @param StoreInterface $fromStore store where we came from
  17. * @param StoreInterface $targetStore store where to go to
  18. * @param string $redirectUrl original url requested for redirect after switching
  19. * @return string url to be redirected after switching
  20. * @throws CannotSwitchStoreException
  21. */
  22. public function switch(StoreInterface $fromStore, StoreInterface $targetStore, string $redirectUrl): string;
  23. }