Skip to content
This repository has been archived by the owner on May 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #16 from bitsandlikes-shopware/fix/AppTemplate-iss…
Browse files Browse the repository at this point in the history
…ue-14

Fix for AppTemplate issue #14
  • Loading branch information
Christian-Rades authored Mar 17, 2023
2 parents 269e6d3 + dd58e36 commit 794326d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Shop/ShopRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function createShop(ShopInterface $shop): void
$queryBuilder->execute();
}

public function getShopFromId(string $shopId): ShopInterface
public function getShopFromId(string $shopId): ?ShopInterface
{
$queryBuilder = $this->connection->createQueryBuilder();
$queryBuilder->select('shop_id', 'shop_url', 'shop_secret', 'api_key', 'secret_key')
Expand All @@ -43,6 +43,10 @@ public function getShopFromId(string $shopId): ShopInterface

$shop = $queryBuilder->execute()->fetchAssociative();

if ($shop === false) {
return null;
}

return new ShopEntity(
$shop['shop_id'],
$shop['shop_url'],
Expand Down Expand Up @@ -80,4 +84,4 @@ public function deleteShop(ShopInterface $shop): void

$queryBuilder->execute();
}
}
}

0 comments on commit 794326d

Please sign in to comment.