Skip to content

Commit bb9590c

Browse files
committed
NEXT-23917 - Remove mentions of EntityRepositoryInterface
1 parent ec93ed1 commit bb9590c

File tree

13 files changed

+46
-73
lines changed

13 files changed

+46
-73
lines changed

concepts/framework/data-abstraction-layer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ An EntityRepository is used to interact with the DAL. This is the recommended wa
1212

1313
### Provisioning code to use the repositories
1414

15-
Before using the repositories, you'll need to get them from the DIC. This is done with [constructor injection](https://symfony.com/doc/current/service_container/injection_types.html#constructor-injection), so you'll need to extend your services constructor by expecting an EntityRepositoryInterface:
15+
Before using the repositories, you'll need to get them from the DIC. This is done with [constructor injection](https://symfony.com/doc/current/service_container/injection_types.html#constructor-injection), so you'll need to extend your services constructor by expecting an EntityRepository:
1616

1717
{% code title="<plugin root>/src/Service/DalExampleService.php" %}
1818

1919
```php
20-
public function __construct (EntityRepositoryInterface $productRepository)
20+
public function __construct (EntityRepository $productRepository)
2121
{
2222
$this->productRepository = $productRepository;
2323
}

guides/plugins/plugins/checkout/payment/add-payment-plugin.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ An example for your plugin could look like this:
389389
namespace Swag\BasicExample;
390390

391391
use Shopware\Core\Framework\Context;
392-
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
392+
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
393393
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
394394
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter;
395395
use Shopware\Core\Framework\Plugin;
@@ -447,14 +447,14 @@ class SwagBasicExample extends Plugin
447447
'pluginId' => $pluginId,
448448
];
449449

450-
/** @var EntityRepositoryInterface $paymentRepository */
450+
/** @var EntityRepository $paymentRepository */
451451
$paymentRepository = $this->container->get('payment_method.repository');
452452
$paymentRepository->create([$examplePaymentData], $context);
453453
}
454454

455455
private function setPaymentMethodIsActive(bool $active, Context $context): void
456456
{
457-
/** @var EntityRepositoryInterface $paymentRepository */
457+
/** @var EntityRepository $paymentRepository */
458458
$paymentRepository = $this->container->get('payment_method.repository');
459459

460460
$paymentMethodId = $this->getPaymentMethodId();
@@ -474,7 +474,7 @@ class SwagBasicExample extends Plugin
474474

475475
private function getPaymentMethodId(): ?string
476476
{
477-
/** @var EntityRepositoryInterface $paymentRepository */
477+
/** @var EntityRepository $paymentRepository */
478478
$paymentRepository = $this->container->get('payment_method.repository');
479479

480480
// Fetch ID for update

guides/plugins/plugins/content/seo/add-custom-seo-url.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -492,32 +492,23 @@ use Cocur\Slugify\SlugifyInterface;
492492
use Shopware\Core\Content\Seo\SeoUrlPersister;
493493
use Shopware\Core\Defaults;
494494
use Shopware\Core\Framework\Context;
495-
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
495+
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
496496
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
497497
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter;
498498

499499
class DynamicSeoUrlsService
500500
{
501501
public const ROUTE_NAME = 'example.route.name';
502502

503-
/**
504-
* @var SeoUrlPersister
505-
*/
506503
private SeoUrlPersister $seoUrlPersister;
507504

508-
/**
509-
* @var EntityRepositoryInterface
510-
*/
511-
private EntityRepositoryInterface $salesChannelRepository;
505+
private EntityRepository $salesChannelRepository;
512506

513-
/**
514-
* @var SlugifyInterface
515-
*/
516507
private SlugifyInterface $slugify;
517508

518509
public function __construct(
519510
SeoUrlPersister $seoUrlPersister,
520-
EntityRepositoryInterface $salesChannelRepository,
511+
EntityRepository $salesChannelRepository,
521512
SlugifyInterface $slugify
522513
) {
523514
$this->seoUrlPersister = $seoUrlPersister;

guides/plugins/plugins/content/sitemap/add-custom-sitemap-entries.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use Shopware\Core\Content\Sitemap\Provider\AbstractUrlProvider;
4444
use Shopware\Core\Content\Sitemap\Struct\Url;
4545
use Shopware\Core\Content\Sitemap\Struct\UrlResult;
4646
use Shopware\Core\Framework\DataAbstractionLayer\Doctrine\FetchModeHelper;
47-
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
47+
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
4848
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
4949
use Shopware\Core\Framework\Plugin\Exception\DecorationPatternException;
5050
use Shopware\Core\System\SalesChannel\SalesChannelContext;
@@ -57,23 +57,14 @@ class CustomUrlProvider extends AbstractUrlProvider
5757
public const CHANGE_FREQ = 'daily';
5858
public const PRIORITY = 1.0;
5959

60-
/**
61-
* @var EntityRepositoryInterface
62-
*/
63-
private EntityRepositoryInterface $exampleRepository;
60+
private EntityRepository $exampleRepository;
6461

65-
/**
66-
* @var Connection
67-
*/
6862
private Connection $connection;
6963

70-
/**
71-
* @var RouterInterface
72-
*/
7364
private RouterInterface $router;
7465

7566
public function __construct(
76-
EntityRepositoryInterface $exampleRepository,
67+
EntityRepository $exampleRepository,
7768
Connection $connection,
7869
RouterInterface $router
7970
) {

guides/plugins/plugins/framework/custom-field/fetching-data-from-entity-selection.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,18 +150,18 @@ Now we can use the product repository in our subscriber.
150150
namespace Swag\BasicExample\Subscriber;
151151

152152
use Shopware\Core\Content\Product\ProductEntity;
153-
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
153+
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
154154
use Shopware\Core\Framework\DataAbstractionLayer\Event\EntityLoadedEvent;
155155
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
156156
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
157157
use Shopware\Core\Content\Product\ProductEvents;
158158

159159
class ProductSubscriber implements EventSubscriberInterface
160160
{
161-
private EntityRepositoryInterface $productRepository;
161+
private EntityRepository $productRepository;
162162

163163
public function __construct(
164-
EntityRepositoryInterface $productRepository
164+
EntityRepository $productRepository
165165
) {
166166
$this->productRepository = $productRepository;
167167
}
@@ -184,18 +184,18 @@ Let's have a look at the final implementation of the subscriber.
184184
namespace Swag\BasicExample\Subscriber;
185185

186186
use Shopware\Core\Content\Product\ProductEntity;
187-
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
187+
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
188188
use Shopware\Core\Framework\DataAbstractionLayer\Event\EntityLoadedEvent;
189189
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
190190
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
191191
use Shopware\Core\Content\Product\ProductEvents;
192192

193193
class ProductSubscriber implements EventSubscriberInterface
194194
{
195-
private EntityRepositoryInterface $productRepository;
195+
private EntityRepository $productRepository;
196196

197197
public function __construct(
198-
EntityRepositoryInterface $productRepository
198+
EntityRepository $productRepository
199199
) {
200200
$this->productRepository = $productRepository;
201201
}

guides/plugins/plugins/framework/data-handling/add-data-indexer.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,23 @@ namespace Swag\BasicExample\Core\Framework\DataAbstractionLayer\Indexing;
2222
use Doctrine\DBAL\Connection;
2323
use Shopware\Core\Checkout\Customer\CustomerDefinition;
2424
use Shopware\Core\Framework\DataAbstractionLayer\Dbal\Common\IteratorFactory;
25-
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
25+
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
2626
use Shopware\Core\Framework\DataAbstractionLayer\Event\EntityWrittenContainerEvent;
2727
use Shopware\Core\Framework\DataAbstractionLayer\Indexing\EntityIndexer;
2828
use Shopware\Core\Framework\DataAbstractionLayer\Indexing\EntityIndexingMessage;
2929
use Shopware\Core\Framework\Uuid\Uuid;
3030

3131
class ExampleIndexer extends EntityIndexer
3232
{
33-
/**
34-
* @var IteratorFactory
35-
*/
3633
private IteratorFactory $iteratorFactory;
3734

38-
/**
39-
* @var EntityRepositoryInterface
40-
*/
41-
private EntityRepositoryInterface $repository;
35+
private EntityRepository $repository;
4236

43-
/**
44-
* @var Connection
45-
*/
4637
private Connection $connection;
4738

4839
public function __construct(
4940
IteratorFactory $iteratorFactory,
50-
EntityRepositoryInterface $repository,
41+
EntityRepository $repository,
5142
Connection $connection
5243
) {
5344
$this->iteratorFactory = $iteratorFactory;

guides/plugins/plugins/framework/data-handling/reading-data.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ And here's the respective class including its constructor:
4343

4444
namespace Swag\BasicExample\Service;
4545

46-
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
46+
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
4747

4848
class ReadingData
4949
{
50-
private EntityRepositoryInterface $productRepository;
50+
private EntityRepository $productRepository;
5151

52-
public function __construct(EntityRepositoryInterface $productRepository)
52+
public function __construct(EntityRepository $productRepository)
5353
{
5454
$this->productRepository = $productRepository;
5555
}

guides/plugins/plugins/framework/data-handling/writing-data.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ And here's the respective class including its constructor:
5252

5353
namespace Swag\BasicExample\Service;
5454

55-
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
55+
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
5656

5757
class WritingData
5858
{
59-
private EntityRepositoryInterface $productRepository;
59+
private EntityRepository $productRepository;
6060

61-
private EntityRepositoryInterface $taxRepository;
61+
private EntityRepository $taxRepository;
6262

63-
public function __construct(EntityRepositoryInterface $productRepository, EntityRepositoryInterface $taxRepository)
63+
public function __construct(EntityRepository $productRepository, EntityRepository $taxRepository)
6464
{
6565
$this->productRepository = $productRepository;
6666
$this->taxRepository = $taxRepository;

guides/plugins/plugins/framework/flow/add-flow-builder-action.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,16 @@ Our new class has to extend from the abstract class `Shopware\Core\Framework\Eve
7575
namespace Swag\ExamplePlugin\Core\Content\Flow\Dispatching\Action;
7676

7777
use Shopware\Core\Content\Flow\Dispatching\Action\FlowAction;
78-
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
78+
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
7979
use Shopware\Core\Framework\Uuid\Uuid;
8080
use Swag\ExamplePlugin\Core\Framework\Event\TagAware;
8181
use Shopware\Core\Framework\Event\FlowEvent;
8282

8383
class CreateTagAction extends FlowAction
8484
{
85-
private EntityRepositoryInterface $tagRepository;
85+
private EntityRepository $tagRepository;
8686

87-
public function __construct(EntityRepositoryInterface $tagRepository)
87+
public function __construct(EntityRepository $tagRepository)
8888
{
8989
// you would need this repository to create a tag
9090
$this->tagRepository = $tagRepository;
@@ -162,16 +162,16 @@ As you can see, several methods are already implemented:
162162
namespace Swag\ExamplePlugin\Core\Content\Flow\Dispatching\Action;
163163

164164
use Shopware\Core\Content\Flow\Dispatching\Action\FlowAction;
165-
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
165+
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
166166
use Shopware\Core\Framework\Uuid\Uuid;
167167
use Swag\ExamplePlugin\Core\Framework\Event\TagAware;
168168
use Shopware\Core\Content\Flow\Dispatching\StorableFlow;
169169

170170
class CreateTagAction extends FlowAction
171171
{
172-
private EntityRepositoryInterface $tagRepository;
172+
private EntityRepository $tagRepository;
173173

174-
public function __construct(EntityRepositoryInterface $tagRepository)
174+
public function __construct(EntityRepository $tagRepository)
175175
{
176176
// you would need this repository to create a tag
177177
$this->tagRepository = $tagRepository;

guides/plugins/plugins/framework/store-api/add-store-api-route.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Now we can create a new class `ExampleRoute` which uses our previously created `
5454
namespace Swag\BasicExample\Core\Content\Example\SalesChannel;
5555

5656
use OpenApi\Annotations as OA;
57-
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
57+
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
5858
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
5959
use Shopware\Core\Framework\Plugin\Exception\DecorationPatternException;
6060
use Shopware\Core\Framework\Routing\Annotation\Entity;
@@ -66,9 +66,9 @@ use Symfony\Component\Routing\Annotation\Route;
6666
*/
6767
class ExampleRoute extends AbstractExampleRoute
6868
{
69-
protected EntityRepositoryInterface $exampleRepository;
69+
protected EntityRepository $exampleRepository;
7070

71-
public function __construct(EntityRepositoryInterface $exampleRepository)
71+
public function __construct(EntityRepository $exampleRepository)
7272
{
7373
$this->exampleRepository = $exampleRepository;
7474
}

0 commit comments

Comments
 (0)