Completed
Pull Request — 1.1 (#633)
by
unknown
03:19
created

ParentDocument   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 29
rs 10

2 Methods

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