ReferenceEntity::setParent()   A
last analyzed

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 1
1
<?php
2
3
namespace ScayTrase\Api\Cruds\Tests\Fixtures\Common\Entity;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
7
class ReferenceEntity
8
{
9
    /**
10
     * @var int|null
11
     */
12
    private $id;
13
14
    /**
15
     * @var MyEntity
16
     */
17
    private $reference;
18
19
    /**
20
     * @var ReferenceEntity
21
     */
22
    private $parent;
23
24
    /**
25
     * @var ReferenceEntity[]|ArrayCollection
26
     */
27
    private $children;
28
29
    /**
30
     * ReferenceEntity constructor.
31
     */
32
    public function __construct()
33
    {
34
        $this->children = new ArrayCollection();
35
    }
36
37
    /**
38
     * @return MyEntity
39
     */
40
    public function getReference()
41
    {
42
        return $this->reference;
43
    }
44
45
    /**
46
     * @param MyEntity $reference
47
     */
48
    public function setReference($reference)
49
    {
50
        $this->reference = $reference;
51
    }
52
53
    /**
54
     * @return ReferenceEntity
55
     */
56
    public function getParent()
57
    {
58
        return $this->parent;
59
    }
60
61
    /**
62
     * @param ReferenceEntity $parent
63
     */
64
    public function setParent($parent)
65
    {
66
        $this->parent = $parent;
67
    }
68
69
    /**
70
     * @return ReferenceEntity[]
71
     */
72
    public function getChildren()
73
    {
74
        return $this->children->toArray();
75
    }
76
77
    /**
78
     * @return int|null
79
     */
80
    public function getId()
81
    {
82
        return $this->id;
83
    }
84
}
85