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 #12 from shopware/implement-shop-interface
Browse files Browse the repository at this point in the history
Implement ShopInterface
  • Loading branch information
fschmtt authored Jan 3, 2022
2 parents aa888a6 + 413e8fc commit 0c9509d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Shop/ShopRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Doctrine\DBAL\Connection;
use Shopware\AppBundle\Shop\ShopEntity;
use Shopware\AppBundle\Shop\ShopInterface;
use Shopware\AppBundle\Shop\ShopRepositoryInterface;

class ShopRepository implements ShopRepositoryInterface
Expand All @@ -13,7 +14,7 @@ public function __construct(
) {
}

public function createShop(ShopEntity $shop): void
public function createShop(ShopInterface $shop): void
{
$queryBuilder = $this->connection->createQueryBuilder();
$queryBuilder
Expand All @@ -32,7 +33,7 @@ public function createShop(ShopEntity $shop): void
$queryBuilder->execute();
}

public function getShopFromId(string $shopId): ShopEntity
public function getShopFromId(string $shopId): ShopInterface
{
$queryBuilder = $this->connection->createQueryBuilder();
$queryBuilder->select('shop_id', 'shop_url', 'shop_secret', 'api_key', 'secret_key')
Expand All @@ -51,7 +52,7 @@ public function getShopFromId(string $shopId): ShopEntity
);
}

public function updateShop(ShopEntity $shop): void
public function updateShop(ShopInterface $shop): void
{
$queryBuilder = $this->connection->createQueryBuilder();
$queryBuilder
Expand All @@ -70,7 +71,7 @@ public function updateShop(ShopEntity $shop): void
$queryBuilder->execute();
}

public function deleteShop(ShopEntity $shop): void
public function deleteShop(ShopInterface $shop): void
{
$queryBuilder = $this->connection->createQueryBuilder();
$queryBuilder->delete('shop')
Expand Down

0 comments on commit 0c9509d

Please sign in to comment.