Completed
Push — feature/EVO-6307-record-origin... ( 2c1fcb )
by Narcotic
61:45
created

Field::isRecordOriginException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 1
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Part of JSON definition
4
 */
5
namespace Graviton\GeneratorBundle\Definition\Schema;
6
7
use Graviton\GeneratorBundle\Definition\Schema\XDynamicKey;
8
9
/**
10
 * JSON definition "target.fields"
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 Field
17
{
18
    /**
19
     * @var string
20
     */
21
    private $name;
22
    /**
23
     * @var string
24
     */
25
    private $type;
26
    /**
27
     * @var int
28
     */
29
    private $length;
30
    /**
31
     * @var string
32
     */
33
    private $title;
34
    /**
35
     * @var string
36
     */
37
    private $description;
38
    /**
39
     * @var string
40
     */
41
    private $exposeAs;
42
    /**
43
     * @var bool
44
     */
45
    private $readOnly = false;
46
    /**
47
     * @var bool
48
     */
49
    private $recordOriginException = false;
50
    /**
51
     * @var bool
52
     */
53
    private $required = false;
54
    /**
55
     * @var integer
56
     */
57
    private $searchable = 0;
58
    /**
59
     * @var bool
60
     */
61
    private $translatable = false;
62
    /**
63
     * @var Constraint[]
64
     */
65
    private $constraints = [];
66
67
    /**
68
     * @var array
69
     */
70
    private $collection = [];
71
72
    /**
73
     * @var XDynamicKey
74
     */
75
    private $xDynamicKey;
76
77
    /**
78
     * @return string
79
     */
80
    public function getName()
81
    {
82
        return $this->name;
83
    }
84
85
    /**
86
     * @param string $name Field name
87
     * @return $this
88
     */
89
    public function setName($name)
90
    {
91
        $this->name = $name;
92
        return $this;
93
    }
94
95
    /**
96
     * @return string
97
     */
98
    public function getType()
99
    {
100
        return $this->type;
101
    }
102
103
    /**
104
     * @param string $type Field type
105
     * @return $this
106
     */
107
    public function setType($type)
108
    {
109
        $this->type = $type;
110
        return $this;
111
    }
112
113
    /**
114
     * @return int
115
     */
116
    public function getLength()
117
    {
118
        return $this->length;
119
    }
120
121
    /**
122
     * @param int $length Field length
123
     * @return $this
124
     */
125
    public function setLength($length)
126
    {
127
        $this->length = $length;
128
        return $this;
129
    }
130
131
    /**
132
     * @return string
133
     */
134
    public function getTitle()
135
    {
136
        return $this->title;
137
    }
138
139
    /**
140
     * @param string $title Field title
141
     * @return $this
142
     */
143
    public function setTitle($title)
144
    {
145
        $this->title = $title;
146
        return $this;
147
    }
148
149
    /**
150
     * @return string
151
     */
152
    public function getDescription()
153
    {
154
        return $this->description;
155
    }
156
157
    /**
158
     * @param string $description Field description
159
     * @return $this
160
     */
161
    public function setDescription($description)
162
    {
163
        $this->description = $description;
164
        return $this;
165
    }
166
167
    /**
168
     * @return string
169
     */
170
    public function getExposeAs()
171
    {
172
        return $this->exposeAs;
173
    }
174
175
    /**
176
     * @param string $exposeAs Expose field as ...
177
     * @return $this
178
     */
179
    public function setExposeAs($exposeAs)
180
    {
181
        $this->exposeAs = $exposeAs;
182
        return $this;
183
    }
184
185
    /**
186
     * @return bool
187
     */
188
    public function getReadOnly()
0 ignored issues
show
Coding Style introduced by
function getReadOnly() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
189
    {
190
        return $this->readOnly;
191
    }
192
193
    /**
194
     * @param bool $readOnly Is field readonly
195
     * @return $this
196
     */
197
    public function setReadOnly($readOnly)
198
    {
199
        $this->readOnly = $readOnly;
200
        return $this;
201
    }
202
203
    /**
204
     * get RecordOriginException
205
     *
206
     * @return boolean RecordOriginException
207
     */
208
    public function isRecordOriginException()
209
    {
210
        return $this->recordOriginException;
211
    }
212
213
    /**
214
     * set RecordOriginException
215
     *
216
     * @param boolean $recordOriginException recordOriginException
217
     *
218
     * @return void
219
     */
220
    public function setRecordOriginException($recordOriginException)
221
    {
222
        $this->recordOriginException = $recordOriginException;
223
    }
224
225
    /**
226
     * @return bool
227
     */
228
    public function getRequired()
0 ignored issues
show
Coding Style introduced by
function getRequired() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
229
    {
230
        return $this->required;
231
    }
232
233
    /**
234
     * @param bool $required Is field required
235
     * @return $this
236
     */
237
    public function setRequired($required)
238
    {
239
        $this->required = $required;
240
        return $this;
241
    }
242
243
    /**
244
     * @return bool
245
     */
246
    public function getTranslatable()
0 ignored issues
show
Coding Style introduced by
function getTranslatable() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
247
    {
248
        return $this->translatable;
249
    }
250
251
    /**
252
     * @param bool $translatable Is field translatable
253
     * @return $this
254
     */
255
    public function setTranslatable($translatable)
256
    {
257
        $this->translatable = $translatable;
258
        return $this;
259
    }
260
261
    /**
262
     * @return Constraint[]
263
     */
264
    public function getConstraints()
265
    {
266
        return $this->constraints;
267
    }
268
269
    /**
270
     * @param Constraint[] $constraints Field constraints
271
     * @return $this
272
     */
273
    public function setConstraints(array $constraints)
274
    {
275
        $this->constraints = $constraints;
276
        return $this;
277
    }
278
279
    /**
280
     * @return array
281
     */
282
    public function getCollection()
283
    {
284
        return $this->collection;
285
    }
286
287
    /**
288
     * @param array $collection Field
289
     * @return $this
290
     */
291
    public function setCollection(array $collection)
292
    {
293
        $this->collection = $collection;
294
        return $this;
295
    }
296
297
    /**
298
     * @return XDynamicKey
299
     */
300
    public function getXDynamicKey()
301
    {
302
        return $this->xDynamicKey;
303
    }
304
305
    /**
306
     * @param XDynamicKey $xDynamicKey x-dynamic-key field value
307
     * @return $this
308
     */
309
    public function setXDynamicKey(XDynamicKey $xDynamicKey)
310
    {
311
        $this->xDynamicKey = $xDynamicKey;
312
        return $this;
313
    }
314
315
    /**
316
     * @return integer
317
     */
318
    public function getSearchable()
319
    {
320
        return (int) $this->searchable;
321
    }
322
323
    /**
324
     * @param integer $searchable searchable flag
325
     *
326
     * @return void
327
     */
328
    public function setSearchable($searchable)
329
    {
330
        $this->searchable = (int) $searchable;
331
    }
332
}
333