Passed
Push — feature/initial-implementation ( 79751f...3b7c72 )
by Fike
01:53
created

Entity   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
dl 0
loc 57
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getMapping() 0 3 1
A setIndexing() 0 4 1
A __construct() 0 6 1
A getIndexing() 0 3 1
A setMapping() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AmaTeam\ElasticSearch\Entity;
6
7
use AmaTeam\ElasticSearch\API\Entity\EntityInterface;
8
use AmaTeam\ElasticSearch\API\Entity\Indexing\IndexingInterface;
9
use AmaTeam\ElasticSearch\API\Entity\Mapping\ClassMappingInterface;
10
11
class Entity implements EntityInterface
12
{
13
    /**
14
     * @var ClassMappingInterface
15
     */
16
    private $mapping;
17
    /**
18
     * @var IndexingInterface
19
     */
20
    private $indexing;
21
22
    /**
23
     * @param ClassMappingInterface $mapping
24
     * @param IndexingInterface $indexing
25
     */
26
    public function __construct(
27
        ClassMappingInterface $mapping = null,
28
        IndexingInterface $indexing = null
29
    ) {
30
        $this->mapping = $mapping;
31
        $this->indexing = $indexing;
32
    }
33
34
    /**
35
     * @return ClassMappingInterface
36
     */
37
    public function getMapping(): ?ClassMappingInterface
38
    {
39
        return $this->mapping;
40
    }
41
42
    /**
43
     * @param ClassMappingInterface $mapping
44
     * @return $this
45
     */
46
    public function setMapping(ClassMappingInterface $mapping)
47
    {
48
        $this->mapping = $mapping;
49
        return $this;
50
    }
51
52
    /**
53
     * @return IndexingInterface
54
     */
55
    public function getIndexing(): ?IndexingInterface
56
    {
57
        return $this->indexing;
58
    }
59
60
    /**
61
     * @param IndexingInterface $indexing
62
     * @return $this
63
     */
64
    public function setIndexing(IndexingInterface $indexing)
65
    {
66
        $this->indexing = $indexing;
67
        return $this;
68
    }
69
}
70