Passed
Push — master ( 1c3fc1...f51d93 )
by Mike
02:44
created

ElasticsearchFacade::createDocuments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Xervice\Elasticsearch\Business;
5
6
7
use DataProvider\DocumentListDataProvider;
8
use Xervice\Core\Business\Model\Facade\AbstractFacade;
9
use Xervice\Elasticsearch\Dependency\Plugin\DocumentBuilderPlugin;
10
11
/**
12
 * @method \Xervice\Elasticsearch\Business\ElasticsearchBusinessFactory getFactory()
13
 * @method \Xervice\Elasticsearch\ElasticsearchConfig getConfig()
14
 */
15
class ElasticsearchFacade extends AbstractFacade
16
{
17
    /**
18
     * Generate all indizes in elasticsearch
19
     *
20
     * @api
21
     */
22 1
    public function createIndizes(): void
23
    {
24
        $this
25 1
            ->getFactory()
26 1
            ->createIndexer()
27 1
            ->createIndizes();
28 1
    }
29
30
    /**
31
     * Create a list of documents in elasticsearch
32
     *
33
     * @api
34
     *
35
     * @param \DataProvider\DocumentListDataProvider $listDataProvider
36
     */
37 1
    public function createDocuments(DocumentListDataProvider $listDataProvider): void
38
    {
39
        $this
40 1
            ->getFactory()
41 1
            ->createDocumentBuilder()
42 1
            ->createDocuments($listDataProvider);
43
    }
44
}