Completed
Pull Request — master (#537)
by Mantas
27:04 queued 01:46
created

ParentDocument::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 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4286
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
use Doctrine\Common\Annotations\Annotation\Required;
15
16
/**
17
 * Annotation used to enable parent-child relationship.
18
 *
19
 * @Annotation
20
 * @Target("PROPERTY")
21
 */
22
final class ParentDocument implements MetaField
23
{
24
    /**
25
     * Parent document class name.
26
     *
27
     * @var string
28
     *
29
     * @Required
30
     */
31
    public $class;
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function getName()
37
    {
38
        return '_parent';
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    public function getSettings()
45
    {
46
        return [
47
            'type' => null, // Actual value will be generated from $class property
48
        ];
49
    }
50
}
51