You are here

public function ChainStoreResolver::resolve in Commerce Core 8.2

Resolves the store.

Return value

\Drupal\commerce_store\Entity\StoreInterface|null The store, if resolved. Otherwise NULL, indicating that the next resolver in the chain should be called.

Overrides StoreResolverInterface::resolve

File

modules/store/src/Resolver/ChainStoreResolver.php, line 44

Class

ChainStoreResolver
Default implementation of the chain store resolver.

Namespace

Drupal\commerce_store\Resolver

Code

public function resolve() {
  foreach ($this->resolvers as $resolver) {
    $result = $resolver
      ->resolve();
    if ($result) {
      return $result;
    }
  }
}