Completed
Push — 1.2 ( b13b4a )
by Simonas
10s
created

Routing::getSettings()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
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
/**
15
 * Annotation used to enable ROUTING and associate document property with _routing meta-field.
16
 *
17
 * @Annotation
18
 * @Target("PROPERTY")
19
 */
20
final class Routing implements MetaField
21
{
22
    /**
23
     * @var bool
24
     */
25
    public $required = false;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function getName()
31
    {
32
        return '_routing';
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function getSettings()
39
    {
40
        return [
41
            'required' => $this->required
42
        ];
43
    }
44
}
45