Completed
Push — feature/EVO-5807 ( fb3b19 )
by
unknown
65:50
created

Field::setHideOnEmptyExtref()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
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 $hideOnEmptyExtref = false;
54
    /**
55
     * @var bool
56
     */
57
    private $required = false;
58
    /**
59
     * @var integer
60
     */
61
    private $searchable = 0;
62
    /**
63
     * @var bool
64
     */
65
    private $translatable = false;
66
    /**
67
     * @var Constraint[]
68
     */
69
    private $constraints = [];
70
71
    /**
72
     * @var array
73
     */
74
    private $collection = [];
75
76
    /**
77
     * @var XDynamicKey
78
     */
79
    private $xDynamicKey;
80
81
    /**
82
     * @return string
83
     */
84
    public function getName()
85
    {
86
        return $this->name;
87
    }
88
89
    /**
90
     * @param string $name Field name
91
     * @return $this
92
     */
93
    public function setName($name)
94
    {
95
        $this->name = $name;
96
        return $this;
97
    }
98
99
    /**
100
     * @return string
101
     */
102
    public function getType()
103
    {
104
        return $this->type;
105
    }
106
107
    /**
108
     * @param string $type Field type
109
     * @return $this
110
     */
111
    public function setType($type)
112
    {
113
        $this->type = $type;
114
        return $this;
115
    }
116
117
    /**
118
     * @return int
119
     */
120
    public function getLength()
121
    {
122
        return $this->length;
123
    }
124
125
    /**
126
     * @param int $length Field length
127
     * @return $this
128
     */
129
    public function setLength($length)
130
    {
131
        $this->length = $length;
132
        return $this;
133
    }
134
135
    /**
136
     * @return string
137
     */
138
    public function getTitle()
139
    {
140
        return $this->title;
141
    }
142
143
    /**
144
     * @param string $title Field title
145
     * @return $this
146
     */
147
    public function setTitle($title)
148
    {
149
        $this->title = $title;
150
        return $this;
151
    }
152
153
    /**
154
     * @return string
155
     */
156
    public function getDescription()
157
    {
158
        return $this->description;
159
    }
160
161
    /**
162
     * @param string $description Field description
163
     * @return $this
164
     */
165
    public function setDescription($description)
166
    {
167
        $this->description = $description;
168
        return $this;
169
    }
170
171
    /**
172
     * @return string
173
     */
174
    public function getExposeAs()
175
    {
176
        return $this->exposeAs;
177
    }
178
179
    /**
180
     * @param string $exposeAs Expose field as ...
181
     * @return $this
182
     */
183
    public function setExposeAs($exposeAs)
184
    {
185
        $this->exposeAs = $exposeAs;
186
        return $this;
187
    }
188
189
    /**
190
     * @return bool
191
     */
192
    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...
193
    {
194
        return $this->readOnly;
195
    }
196
197
    /**
198
     * @param bool $readOnly Is field readonly
199
     * @return $this
200
     */
201
    public function setReadOnly($readOnly)
202
    {
203
        $this->readOnly = $readOnly;
204
        return $this;
205
    }
206
207
    /**
208
     * is HideOnEmptyExtref
209
     *
210
     * @return boolean HideOnEmptyExtref
211
     */
212
    public function isHideOnEmptyExtref()
213
    {
214
        return $this->hideOnEmptyExtref;
215
    }
216
217
    /**
218
     * set setHideOnEmptyExtref
219
     *
220
     * @param boolean $hideOnEmptyExtref hideOnEmptyExtref
221
     *
222
     * @return void
223
     */
224
    public function setHideOnEmptyExtref($hideOnEmptyExtref)
225
    {
226
        $this->hideOnEmptyExtref = $hideOnEmptyExtref;
227
    }
228
229
    /**
230
     * get RecordOriginException
231
     *
232
     * @return boolean RecordOriginException
233
     */
234
    public function isRecordOriginException()
235
    {
236
        return $this->recordOriginException;
237
    }
238
239
    /**
240
     * set RecordOriginException
241
     *
242
     * @param boolean $recordOriginException recordOriginException
243
     *
244
     * @return void
245
     */
246
    public function setRecordOriginException($recordOriginException)
247
    {
248
        $this->recordOriginException = $recordOriginException;
249
    }
250
251
    /**
252
     * @return bool
253
     */
254
    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...
255
    {
256
        return $this->required;
257
    }
258
259
    /**
260
     * @param bool $required Is field required
261
     * @return $this
262
     */
263
    public function setRequired($required)
264
    {
265
        $this->required = $required;
266
        return $this;
267
    }
268
269
    /**
270
     * @return bool
271
     */
272
    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...
273
    {
274
        return $this->translatable;
275
    }
276
277
    /**
278
     * @param bool $translatable Is field translatable
279
     * @return $this
280
     */
281
    public function setTranslatable($translatable)
282
    {
283
        $this->translatable = $translatable;
284
        return $this;
285
    }
286
287
    /**
288
     * @return Constraint[]
289
     */
290
    public function getConstraints()
291
    {
292
        return $this->constraints;
293
    }
294
295
    /**
296
     * @param Constraint[] $constraints Field constraints
297
     * @return $this
298
     */
299
    public function setConstraints(array $constraints)
300
    {
301
        $this->constraints = $constraints;
302
        return $this;
303
    }
304
305
    /**
306
     * @return array
307
     */
308
    public function getCollection()
309
    {
310
        return $this->collection;
311
    }
312
313
    /**
314
     * @param array $collection Field
315
     * @return $this
316
     */
317
    public function setCollection(array $collection)
318
    {
319
        $this->collection = $collection;
320
        return $this;
321
    }
322
323
    /**
324
     * @return XDynamicKey
325
     */
326
    public function getXDynamicKey()
327
    {
328
        return $this->xDynamicKey;
329
    }
330
331
    /**
332
     * @param XDynamicKey $xDynamicKey x-dynamic-key field value
333
     * @return $this
334
     */
335
    public function setXDynamicKey(XDynamicKey $xDynamicKey)
336
    {
337
        $this->xDynamicKey = $xDynamicKey;
338
        return $this;
339
    }
340
341
    /**
342
     * @return integer
343
     */
344
    public function getSearchable()
345
    {
346
        return (int) $this->searchable;
347
    }
348
349
    /**
350
     * @param integer $searchable searchable flag
351
     *
352
     * @return void
353
     */
354
    public function setSearchable($searchable)
355
    {
356
        $this->searchable = (int) $searchable;
357
    }
358
}
359