Completed
Pull Request — master (#537)
by Mantas
27:04 queued 01:46
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
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