Completed
Push — master ( d7ee7d...0530ba )
by Leny
06:17
created

ViewReference::setChildren()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Victoire\Bundle\ViewReferenceBundle\ViewReference;
4
5
class ViewReference
6
{
7
    protected $id;
8
    protected $locale;
9
    protected $name;
10
    protected $slug;
11
    /**
12
     * @var string built by ViewReferenceCacheRepo
13
     */
14
    protected $url;
15
    protected $viewId;
16
    protected $viewNamespace;
17
    protected $children;
18
19
    public function __construct($id = null)
20
    {
21
        $this->id = $id;
22
        $this->children = [];
23
    }
24
25
    /**
26
     * looks like ref_{view.id}[_{view.businessEntity.id}].
27
     *
28
     * @return string
29
     */
30
    public function getId()
31
    {
32
        return $this->id;
33
    }
34
35
    /**
36
     * @param string $id
37
     */
38
    public function setId($id)
39
    {
40
        $this->id = $id;
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getLocale()
47
    {
48
        return $this->locale;
49
    }
50
51
    /**
52
     * @param string $locale
53
     */
54
    public function setLocale($locale)
55
    {
56
        $this->locale = $locale;
57
    }
58
59
    /**
60
     * @return mixed
61
     */
62
    public function getName()
63
    {
64
        return $this->name;
65
    }
66
67
    /**
68
     * @param mixed $name
69
     */
70
    public function setName($name)
71
    {
72
        $this->name = $name;
73
    }
74
75
    /**
76
     * @return mixed
77
     */
78
    public function getViewId()
79
    {
80
        return $this->viewId;
81
    }
82
83
    /**
84
     * @param mixed $viewId
85
     */
86
    public function setViewId($viewId)
87
    {
88
        $this->viewId = $viewId;
89
    }
90
91
    /**
92
     * @return mixed
93
     */
94
    public function getViewNamespace()
95
    {
96
        return $this->viewNamespace;
97
    }
98
99
    /**
100
     * @param mixed $viewNamespace
101
     */
102
    public function setViewNamespace($viewNamespace)
103
    {
104
        $this->viewNamespace = $viewNamespace;
105
    }
106
107
    /**
108
     * @return mixed
109
     */
110
    public function getSlug()
111
    {
112
        return $this->slug;
113
    }
114
115
    /**
116
     * @param mixed $slug
117
     */
118
    public function setSlug($slug)
119
    {
120
        $this->slug = $slug;
121
    }
122
123
    /**
124
     * @return string
125
     */
126
    public function getUrl()
127
    {
128
        return $this->url;
129
    }
130
131
    /**
132
     * @param string $url
133
     */
134
    public function setUrl($url)
135
    {
136
        $this->url = $url;
137
    }
138
139
    /**
140
     * @return ViewReference[]
141
     */
142
    public function getChildren()
143
    {
144
        return $this->children;
145
    }
146
147
    /**
148
     * @param ViewReference[] $children
149
     */
150
    public function setChildren($children)
151
    {
152
        $this->children = $children;
153
    }
154
155
    /**
156
     * @param ViewReference $child
157
     */
158
    public function addChild($child)
159
    {
160
        $this->children[] = $child;
161
    }
162
}
163