Completed
Push — upgrade ( f08820 )
by Simonas
14:39
created

Index::dump()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the ONGR package.
5
 *
6
 * (c) NFQ Technologies UAB <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace ONGR\ElasticsearchBundle\Annotation;
13
14
use ONGR\ElasticsearchBundle\Mapping\DumperInterface;
15
16
/**
17
 * Annotation to mark a class as an Elasticsearch index.
18
 *
19
 * @Annotation
20
 * @Target("CLASS")
21
 */
22
final class Index implements DumperInterface
23
{
24
    /**
25
     * @var string
26
     */
27
    public $indexName;
28
29
    /**
30
     * @deprecated will be removed in v7 since there will be no more types in the indexes.
31
     * @var string
32
     */
33
    public $typeName;
34
35
    /**
36
     * Options is a custom configuration to pass to the client when index is created.
37
     *  e.g. you can use it for the dynamic templates
38
     *
39
     * @var array
40
     */
41
    public $options = [];
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function dump(array $exclude = [])
47
    {
48
        return array_diff_key(
49
            $this->options,
50
            $exclude
51
        );
52
    }
53
}
54