Completed
Push — master ( 772880...0b10b4 )
by Pavel
04:43
created

ReferenceEntity::getReference()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace ScayTrase\Api\Cruds\Tests\Fixtures\Common\Entity;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * @ORM\Entity()
10
 */
11
class ReferenceEntity
12
{
13
    /**
14
     * @var int|null
15
     * @ORM\Id()
16
     * @ORM\Column(type="integer")
17
     * @ORM\GeneratedValue(strategy="AUTO")
18
     */
19
    private $id;
20
21
    /**
22
     * @var MyEntity
23
     * @ORM\ManyToOne(targetEntity="MyEntity")
24
     */
25
    private $reference;
26
27
    /**
28
     * @var ReferenceEntity
29
     * @ORM\ManyToOne(targetEntity="ReferenceEntity", inversedBy="children")
30
     */
31
    private $parent;
32
33
    /**
34
     * @var ReferenceEntity[]|ArrayCollection
35
     * @ORM\OneToMany(targetEntity="ReferenceEntity", mappedBy="parent")
36
     */
37
    private $children;
38
39
    /**
40
     * ReferenceEntity constructor.
41
     */
42
    public function __construct()
43
    {
44
        $this->children = new ArrayCollection();
45
    }
46
47
    /**
48
     * @return MyEntity
49
     */
50
    public function getReference()
51
    {
52
        return $this->reference;
53
    }
54
55
    /**
56
     * @param MyEntity $reference
57
     */
58
    public function setReference($reference)
59
    {
60
        $this->reference = $reference;
61
    }
62
63
    /**
64
     * @return ReferenceEntity
65
     */
66
    public function getParent()
67
    {
68
        return $this->parent;
69
    }
70
71
    /**
72
     * @param ReferenceEntity $parent
73
     */
74
    public function setParent($parent)
75
    {
76
        $this->parent = $parent;
77
    }
78
79
    /**
80
     * @return ArrayCollection|ReferenceEntity[]
81
     */
82
    public function getChildren()
83
    {
84
        return $this->children;
85
    }
86
87
    /**
88
     * @param ArrayCollection|ReferenceEntity[] $children
89
     */
90
    public function setChildren($children)
91
    {
92
        $this->children = $children;
93
    }
94
95
    /**
96
     * @return int|null
97
     */
98
    public function getId()
99
    {
100
        return $this->id;
101
    }
102
}
103