Passed
Push — trunk ( fb06e2...91b192 )
by Christian
11:15 queued 12s
created

triggerElasticsearchIndexing()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 0
loc 8
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Elasticsearch\Migration\Traits;
4
5
use Doctrine\DBAL\Connection;
6
use Shopware\Elasticsearch\Framework\SystemUpdateListener;
7
8
trait ElasticsearchTriggerTrait
9
{
10
    /**
11
     * This method triggers Elasticsearch indexing after Shopware Update
12
     */
13
    public function triggerElasticsearchIndexing(Connection $connection): void
14
    {
15
        $connection->executeStatement(
16
            '
17
            REPLACE INTO app_config (`key`, `value`) VALUES
18
            (?, ?)
19
            ',
20
            [SystemUpdateListener::CONFIG_KEY, json_encode(['*'], \JSON_THROW_ON_ERROR)]
21
        );
22
    }
23
}
24