Completed
Push — feature/EVO-7278-tracking-info... ( bdf2c3...3cd6b4 )
by
unknown
09:23
created

AuditTracking::setCollectionName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * document class for Graviton\AuditTrackingBundle\Document\ActivityLog
4
 */
5
6
namespace Graviton\AuditTrackingBundle\Document;
7
8
use Doctrine\Common\Collections\ArrayCollection;
9
use Graviton\DocumentBundle\Entity\ExtReference;
10
11
/**
12
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
13
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
14
 * @link     http://swisscom.ch
15
 */
16
class AuditTracking
17
{
18
    /**
19
     * @var mixed $id
20
     */
21
    protected $id;
22
    
23
    /**
24
     * @var string $thread
25
     */
26
    protected $thread;
27
28
    /**
29
     * @var string $username
30
     */
31
    protected $username;
32
33
    /**
34
     * @var string $action
35
     */
36
    protected $action;
37
38
    /**
39
     * @var string $type
40
     */
41
    protected $type;
42
43
    /**
44
     * @var string $location
45
     */
46
    protected $location;
47
48
    /**
49
     * @var ArrayCollection $data
50
     */
51
    protected $data;
52
53
    /**
54
     * @var string $collectionName
55
     */
56
    protected $collectionId;
57
58
    /**
59
     * @var string $collectionName
60
     */
61
    protected $collectionName;
62
63
    /**
64
     * @var extref $ref
65
     */
66
    protected $ref;
67
68
    /**
69
     * @var \datetime $createdAt
70
     */
71
    protected $createdAt;
72
73
    /**
74
     * constructor
75
     *
76
     * @return self
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
77
     */
78 4
    public function __construct()
79
    {
80 4
    }
81
82
    /**
83
     * @return mixed
84
     */
85
    public function getId()
86
    {
87
        return $this->id;
88
    }
89
90
    /**
91
     * @return string
92
     */
93
    public function getThread()
94
    {
95
        return $this->thread;
96
    }
97
98
    /**
99
     * @param string $thread string id to UUID thread for user
100
     * @return void
101
     */
102
    public function setThread($thread)
103
    {
104
        $this->thread = $thread;
105
    }
106
107
    /**
108
     * @return string
109
     */
110
    public function getUsername()
111
    {
112
        return $this->username;
113
    }
114
115
    /**
116
     * @param string $username Current user name
117
     * @return void
118
     */
119
    public function setUsername($username)
120
    {
121
        $this->username = $username;
122
    }
123
124
    /**
125
     * @return string
126
     */
127
    public function getAction()
128
    {
129
        return $this->action;
130
    }
131
132
    /**
133
     * @param string $action what happened
134
     * @return void
135
     */
136
    public function setAction($action)
137
    {
138
        $this->action = $action;
139
    }
140
141
    /**
142
     * @return string
143
     */
144
    public function getType()
145
    {
146
        return $this->type;
147
    }
148
149
    /**
150
     * @param string $type type of event
151
     * @return void
152
     */
153
    public function setType($type)
154
    {
155
        $this->type = $type;
156
    }
157
158
    /**
159
     * @return string
160
     */
161
    public function getLocation()
162
    {
163
        return $this->location;
164
    }
165
166
    /**
167
     * @param string $location where did the action happen
168
     * @return void
169
     */
170
    public function setLocation($location)
171
    {
172
        $this->location = $location;
173
    }
174
175
    /**
176
     * @return object
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use ArrayCollection.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
177
     */
178
    public function getData()
179
    {
180
        return empty($this->data) ? null : $this->data;
181
    }
182
183
    /**
184
     * @param Object $data additional information
185
     * @return void
186
     */
187
    public function setData($data)
188
    {
189
        $this->data = $data;
190
    }
191
192
    /**
193
     * @return mixed
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use string.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
194
     */
195
    public function getCollectionId()
196
    {
197
        return $this->collectionId;
198
    }
199
200
    /**
201
     * @param mixed $collectionId Collection ID
202
     * @return void
203
     */
204
    public function setCollectionId($collectionId)
205
    {
206
        $this->collectionId = $collectionId;
207
    }
208
209
    /**
210
     * @return mixed
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use string.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
211
     */
212
    public function getCollectionName()
213
    {
214
        return $this->collectionName;
215
    }
216
217
    /**
218
     * @param mixed $collectionName Collection name
219
     * @return void
220
     */
221
    public function setCollectionName($collectionName)
222
    {
223
        $this->collectionName = $collectionName;
224
    }
225
226
    /**
227
     * @return extref
0 ignored issues
show
Documentation introduced by
Should the return type not be ExtReference|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
228
     */
229
    public function getRef()
230
    {
231
        if ($this->collectionId && $this->collectionName) {
232
            return ExtReference::create($this->collectionName, $this->collectionId);
233
        }
234
235
        return null;
236
    }
237
238
    /**
239
     * @return \datetime
240
     */
241
    public function getCreatedAt()
242
    {
243
        return $this->createdAt;
244
    }
245
246
    /**
247
     * @param \datetime $createdAt when the event took place
248
     * @return void
249
     */
250
    public function setCreatedAt($createdAt)
251
    {
252
        $this->createdAt = $createdAt;
253
    }
254
}
255