Attribute.php 12.8 KB
Newer Older
1
2
<?php

François Agneray's avatar
François Agneray committed
3
/*
4
 * This file is part of Anis Server.
François Agneray's avatar
François Agneray committed
5
 *
6
 * (c) Laboratoire d'Astrophysique de Marseille / CNRS
François Agneray's avatar
François Agneray committed
7
8
9
10
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
11
12
13
declare(strict_types=1);

namespace App\Entity;
François Agneray's avatar
François Agneray committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

use Doctrine\Common\Collections\ArrayCollection;

/**
* @Entity
* @Table(name="attribute")
*/
class Attribute implements \JsonSerializable
{
    /**
     * @var integer
     *
     * @Id
     * @Column(type="integer", nullable=false)
     */
    protected $id;

    /**
32
     * @var App\Entity\Dataset
François Agneray's avatar
François Agneray committed
33
     *
François Agneray's avatar
#9 done    
François Agneray committed
34
     * @Id
35
     * @ManyToOne(targetEntity="Dataset", inversedBy="attributes")
François Agneray's avatar
François Agneray committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
     * @JoinColumn(name="dataset_name", referencedColumnName="name", nullable=false)
     */
    protected $dataset;

    /**
     * @var string
     *
     * @Column(type="string", nullable=false)
     */
    protected $name;

    /**
     * @var string
     *
     * @Column(type="string", name="table_name", nullable=false)
     */
    protected $tableName;

    /**
     * @var string
     *
     * @Column(type="string", nullable=false)
     */
    protected $label;

    /**
     * @var string
     *
     * @Column(type="string", name="form_label", nullable=false)
     */
    protected $formLabel;

    /**
     * @var string
     *
     * @Column(type="string", nullable=true)
     */
    protected $description;

    /**
     * @var integer
     *
     * @Column(type="integer", name="output_display", nullable=true)
     */
    protected $outputDisplay;

    /**
     * @var integer
François Agneray's avatar
François Agneray committed
84
     *
François Agneray's avatar
François Agneray committed
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
     * @Column(type="integer", name="criteria_display", nullable=true)
     */
    protected $criteriaDisplay;

    /**
     * @var string
     *
     * @Column(type="string", name="search_flag", nullable=true)
     */
    protected $searchFlag;

    /**
     * @var string
     *
     * @Column(type="string", name="search_type", nullable=true)
     */
    protected $searchType;

    /**
     * @var string
     *
     * @Column(type="string", nullable=true)
     */
    protected $operator;

    /**
     * @var string
     *
     * @Column(type="string", name="type", nullable=true)
     */
    protected $type;

    /**
     * @var string
     *
     * @Column(type="string", nullable=true)
     */
    protected $min;

    /**
     * @var string
     *
     * @Column(type="string", nullable=true)
     */
    protected $max;

    /**
     * @var string
     *
     * @Column(type="string", name="placeholder_min", nullable=true)
     */
    protected $placeholderMin;
    
    /**
     * @var string
     *
     * @Column(type="string", name="placeholder_max", nullable=true)
     */
    protected $placeholderMax;

    /**
     * @var string
     *
     * @Column(type="string", name="uri_action", nullable=true)
     */
    protected $uriAction;

    /**
     * @var string
     *
     * @Column(type="string", name="renderer", nullable=true)
     */
    protected $renderer;

    /**
     * @var int
     *
     * @Column(type="integer", name="display_detail", nullable=true)
     */
    protected $displayDetail;

    /**
     * @var bool
     *
     * @Column(type="boolean", name="selected", nullable=false, options={"default":false})
     */
François Agneray's avatar
#2 done    
François Agneray committed
171
    protected $selected = false;
François Agneray's avatar
François Agneray committed
172
173
174
175
176
177

    /**
     * @var bool
     *
     * @Column(type="boolean", name="order_by", nullable=false, options={"default":false})
     */
François Agneray's avatar
#2 done    
François Agneray committed
178
    protected $orderBy = false;
François Agneray's avatar
François Agneray committed
179
180
181
182
183
184
185
186
187
188
189
190
191

    /**
     * @var int
     *
     * @Column(type="integer", name="order_display", nullable=true)
     */
    protected $orderDisplay;

    /**
     * @var bool
     *
     * @Column(type="boolean", name="detail", nullable=false, options={"default":false})
     */
François Agneray's avatar
#2 done    
François Agneray committed
192
    protected $detail = false;
François Agneray's avatar
François Agneray committed
193
194
195
196
197
198
199
200

    /**
     * @var string
     *
     * @Column(type="string", name="renderer_detail", nullable=true)
     */
    protected $rendererDetail;

201
202
    /**
     * @var string
François Agneray's avatar
François Agneray committed
203
     *
204
205
206
207
     * @Column(type="json", name="options", nullable=true)
     */
    protected $options;

François Agneray's avatar
François Agneray committed
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
    /**
     * @var string
     *
     * @Column(type="string", name="vo_utype", nullable=true)
     */
    protected $voUtype;

    /**
     * @var string
     *
     * @Column(type="string", name="vo_ucd", nullable=true)
     */
    protected $voUcd;

    /**
     * @var string
     *
     * @Column(type="string", name="vo_unit", nullable=true)
     */
    protected $voUnit;

    /**
     * @var string
     *
     * @Column(type="string", name="vo_description", nullable=true)
     */
    protected $voDescription;

    /**
     * @var string
     *
     * @Column(type="string", name="vo_datatype", nullable=true)
     */
    protected $voDatatype;

    /**
     * @var integer
     *
     * @Column(type="integer", name="vo_size", nullable=true)
     */
    protected $voSize;

    /**
251
     * @var App\Entity\CriteriaFamily
François Agneray's avatar
François Agneray committed
252
     *
François Agneray's avatar
François Agneray committed
253
     * @ManyToOne(targetEntity="CriteriaFamily")
254
     * @JoinColumn(name="criteria_family", referencedColumnName="id", nullable=true)
François Agneray's avatar
François Agneray committed
255
     */
256
    protected $criteriaFamily;
François Agneray's avatar
François Agneray committed
257
258

    /**
259
     * @var App\Entity\OutputCategory
François Agneray's avatar
François Agneray committed
260
     *
François Agneray's avatar
François Agneray committed
261
     * @ManyToOne(targetEntity="OutputCategory")
262
     * @JoinColumn(name="output_category", referencedColumnName="id", nullable=true)
François Agneray's avatar
François Agneray committed
263
     */
264
    protected $outputCategory;
François Agneray's avatar
François Agneray committed
265

François Agneray's avatar
WIP    
François Agneray committed
266
    public function __construct(int $id, Dataset $dataset)
François Agneray's avatar
François Agneray committed
267
    {
François Agneray's avatar
#9 done    
François Agneray committed
268
        $this->id = $id;
François Agneray's avatar
François Agneray committed
269
270
271
        $this->dataset = $dataset;
    }

François Agneray's avatar
François Agneray committed
272
    public function getId()
François Agneray's avatar
François Agneray committed
273
274
275
276
    {
        return $this->id;
    }

François Agneray's avatar
François Agneray committed
277
278
279
280
281
    public function getDataset()
    {
        return $this->dataset;
    }

François Agneray's avatar
François Agneray committed
282
    public function getName()
François Agneray's avatar
François Agneray committed
283
284
285
286
    {
        return $this->name;
    }

François Agneray's avatar
François Agneray committed
287
    public function setName($name)
François Agneray's avatar
#9 done    
François Agneray committed
288
289
290
291
    {
        $this->name = $name;
    }

François Agneray's avatar
François Agneray committed
292
    public function getTableName()
François Agneray's avatar
François Agneray committed
293
294
295
296
    {
        return $this->tableName;
    }

François Agneray's avatar
François Agneray committed
297
    public function setTableName($tableName)
François Agneray's avatar
François Agneray committed
298
299
300
301
    {
        $this->tableName = $tableName;
    }

François Agneray's avatar
François Agneray committed
302
    public function getLabel()
François Agneray's avatar
François Agneray committed
303
304
305
306
    {
        return $this->label;
    }

François Agneray's avatar
François Agneray committed
307
    public function setLabel($label)
François Agneray's avatar
François Agneray committed
308
309
310
311
    {
        $this->label = $label;
    }

François Agneray's avatar
François Agneray committed
312
    public function getFormLabel()
François Agneray's avatar
François Agneray committed
313
314
315
316
    {
        return $this->formLabel;
    }

François Agneray's avatar
François Agneray committed
317
    public function setFormLabel($formLabel)
François Agneray's avatar
François Agneray committed
318
319
320
321
    {
        $this->formLabel = $formLabel;
    }

322
    public function getDescription()
François Agneray's avatar
François Agneray committed
323
324
325
326
    {
        return $this->description;
    }

François Agneray's avatar
François Agneray committed
327
    public function setDescription($description)
François Agneray's avatar
François Agneray committed
328
329
330
331
    {
        $this->description = $description;
    }

François Agneray's avatar
François Agneray committed
332
    public function getOutputDisplay()
François Agneray's avatar
François Agneray committed
333
334
335
336
    {
        return $this->outputDisplay;
    }

François Agneray's avatar
François Agneray committed
337
    public function setOutputDisplay($outputDisplay)
François Agneray's avatar
François Agneray committed
338
339
340
341
    {
        $this->outputDisplay = $outputDisplay;
    }

François Agneray's avatar
François Agneray committed
342
    public function setCriteriaDisplay($criteriaDisplay)
François Agneray's avatar
François Agneray committed
343
344
345
346
    {
        $this->criteriaDisplay = $criteriaDisplay;
    }

François Agneray's avatar
François Agneray committed
347
    public function getCriteriaDisplay()
François Agneray's avatar
François Agneray committed
348
349
350
351
    {
        return $this->criteriaDisplay;
    }

352
    public function getSearchFlag()
François Agneray's avatar
François Agneray committed
353
354
355
356
    {
        return $this->searchFlag;
    }

François Agneray's avatar
François Agneray committed
357
    public function setSearchFlag($searchFlag)
François Agneray's avatar
François Agneray committed
358
359
360
361
    {
        $this->searchFlag = $searchFlag;
    }

362
    public function getSearchType()
François Agneray's avatar
François Agneray committed
363
364
365
366
    {
        return $this->searchType;
    }

François Agneray's avatar
François Agneray committed
367
    public function setSearchType($searchType)
François Agneray's avatar
François Agneray committed
368
369
370
371
    {
        $this->searchType = $searchType;
    }

372
    public function getOperator()
François Agneray's avatar
François Agneray committed
373
374
375
376
    {
        return $this->operator;
    }

François Agneray's avatar
François Agneray committed
377
    public function setOperator($operator)
François Agneray's avatar
François Agneray committed
378
379
380
381
    {
        $this->operator = $operator;
    }

François Agneray's avatar
François Agneray committed
382
    public function getType()
François Agneray's avatar
François Agneray committed
383
384
385
386
    {
        return $this->type;
    }

François Agneray's avatar
François Agneray committed
387
    public function setType($type)
François Agneray's avatar
François Agneray committed
388
389
390
391
    {
        $this->type = $type;
    }

392
    public function getMin()
François Agneray's avatar
François Agneray committed
393
394
395
396
    {
        return $this->min;
    }

François Agneray's avatar
François Agneray committed
397
    public function setMin($min)
François Agneray's avatar
François Agneray committed
398
399
400
401
    {
        $this->min = $min;
    }

402
    public function getMax()
François Agneray's avatar
François Agneray committed
403
404
405
406
    {
        return $this->max;
    }

François Agneray's avatar
François Agneray committed
407
    public function setMax($max)
François Agneray's avatar
François Agneray committed
408
409
410
411
    {
        $this->max = $max;
    }

412
    public function getPlaceholderMin()
François Agneray's avatar
François Agneray committed
413
414
415
416
    {
        return $this->placeholderMin;
    }

François Agneray's avatar
François Agneray committed
417
    public function setPlaceholderMin($placeholderMin)
François Agneray's avatar
François Agneray committed
418
419
420
421
    {
        $this->placeholderMin = $placeholderMin;
    }

422
    public function getPlaceholderMax()
François Agneray's avatar
François Agneray committed
423
424
425
426
    {
        return $this->placeholderMax;
    }

François Agneray's avatar
François Agneray committed
427
    public function setPlaceholderMax($placeholderMax)
François Agneray's avatar
François Agneray committed
428
429
430
431
    {
        $this->placeholderMax = $placeholderMax;
    }

432
    public function getUriAction()
François Agneray's avatar
François Agneray committed
433
434
435
436
    {
        return $this->uriAction;
    }

François Agneray's avatar
François Agneray committed
437
    public function setUriAction($uriAction)
François Agneray's avatar
François Agneray committed
438
439
440
441
    {
        $this->uriAction = $uriAction;
    }

442
    public function getRenderer()
François Agneray's avatar
François Agneray committed
443
444
445
446
    {
        return $this->renderer;
    }

François Agneray's avatar
François Agneray committed
447
    public function setRenderer($renderer)
François Agneray's avatar
François Agneray committed
448
449
450
451
    {
        $this->renderer = $renderer;
    }

François Agneray's avatar
François Agneray committed
452
    public function getDisplayDetail()
François Agneray's avatar
François Agneray committed
453
454
455
456
    {
        return $this->displayDetail;
    }

François Agneray's avatar
François Agneray committed
457
    public function setDisplayDetail($displayDetail)
François Agneray's avatar
François Agneray committed
458
459
460
461
    {
        $this->displayDetail = $displayDetail;
    }

462
    public function getVoUtype()
François Agneray's avatar
François Agneray committed
463
464
465
466
    {
        return $this->voUtype;
    }

François Agneray's avatar
François Agneray committed
467
    public function setVoUtype($voUtype)
François Agneray's avatar
François Agneray committed
468
469
470
471
    {
        $this->voUtype = $voUtype;
    }

472
    public function getVoUcd()
François Agneray's avatar
François Agneray committed
473
474
475
476
    {
        return $this->voUcd;
    }

François Agneray's avatar
François Agneray committed
477
    public function setVoUcd($voUcd)
François Agneray's avatar
François Agneray committed
478
479
480
481
    {
        $this->voUcd = $voUcd;
    }

482
    public function getVoUnit()
François Agneray's avatar
François Agneray committed
483
484
485
486
    {
        return $this->voUnit;
    }

François Agneray's avatar
François Agneray committed
487
    public function setVoUnit($voUnit)
François Agneray's avatar
François Agneray committed
488
489
490
491
    {
        $this->voUnit = $voUnit;
    }

492
    public function getVoDescription()
François Agneray's avatar
François Agneray committed
493
494
495
496
    {
        return $this->voDescription;
    }

François Agneray's avatar
François Agneray committed
497
    public function setVoDescription($voDescription)
François Agneray's avatar
François Agneray committed
498
499
500
501
    {
        $this->voDescription = $voDescription;
    }

502
    public function getVoDatatype()
François Agneray's avatar
François Agneray committed
503
504
505
506
    {
        return $this->voDatatype;
    }

François Agneray's avatar
François Agneray committed
507
    public function setVoDatatype($voDatatype)
François Agneray's avatar
François Agneray committed
508
509
510
511
    {
        $this->voDatatype = $voDatatype;
    }

512
    public function getVoSize()
François Agneray's avatar
François Agneray committed
513
514
515
516
    {
        return $this->voSize;
    }

François Agneray's avatar
François Agneray committed
517
    public function setVoSize($voSize)
François Agneray's avatar
François Agneray committed
518
    {
François Agneray's avatar
WIP    
François Agneray committed
519
        $this->voSize = $voSize;
François Agneray's avatar
François Agneray committed
520
521
    }

François Agneray's avatar
François Agneray committed
522
    public function getSelected()
François Agneray's avatar
François Agneray committed
523
524
525
526
    {
        return $this->selected;
    }

François Agneray's avatar
François Agneray committed
527
    public function setSelected($selected)
François Agneray's avatar
François Agneray committed
528
529
530
531
    {
        $this->selected = $selected;
    }

532
    public function getOrderBy()
François Agneray's avatar
François Agneray committed
533
534
535
536
    {
        return $this->orderBy;
    }

François Agneray's avatar
François Agneray committed
537
    public function setOrderBy($orderBy)
François Agneray's avatar
François Agneray committed
538
539
540
541
    {
        $this->orderBy = $orderBy;
    }

François Agneray's avatar
François Agneray committed
542
    public function getOrderDisplay()
François Agneray's avatar
François Agneray committed
543
544
545
546
    {
        return $this->orderDisplay;
    }

François Agneray's avatar
François Agneray committed
547
    public function setOrderDisplay($orderDisplay)
François Agneray's avatar
François Agneray committed
548
549
550
551
    {
        $this->orderDisplay = $orderDisplay;
    }

552
    public function getDetail()
François Agneray's avatar
François Agneray committed
553
554
555
556
    {
        return $this->detail;
    }

François Agneray's avatar
François Agneray committed
557
    public function setDetail($detail)
François Agneray's avatar
François Agneray committed
558
559
560
561
    {
        $this->detail = $detail;
    }

562
    public function getRendererDetail()
François Agneray's avatar
François Agneray committed
563
564
565
566
    {
        return $this->rendererDetail;
    }

François Agneray's avatar
François Agneray committed
567
    public function setRendererDetail($rendererDetail)
François Agneray's avatar
François Agneray committed
568
569
570
571
    {
        $this->rendererDetail = $rendererDetail;
    }

572
    public function getOptions()
François Agneray's avatar
François Agneray committed
573
    {
574
        return $this->options;
François Agneray's avatar
François Agneray committed
575
576
    }

François Agneray's avatar
François Agneray committed
577
    public function setOptions($options)
François Agneray's avatar
François Agneray committed
578
    {
579
        $this->options = $options;
François Agneray's avatar
François Agneray committed
580
581
    }

582
    public function getCriteriaFamily()
François Agneray's avatar
François Agneray committed
583
    {
584
        return $this->criteriaFamily;
François Agneray's avatar
François Agneray committed
585
    }
586

François Agneray's avatar
François Agneray committed
587
    public function setCriteriaFamily($criteriaFamily)
588
589
590
591
    {
        $this->criteriaFamily = $criteriaFamily;
    }

592
    public function getOutputCategory()
François Agneray's avatar
François Agneray committed
593
    {
594
        return $this->outputCategory;
François Agneray's avatar
François Agneray committed
595
596
    }

François Agneray's avatar
François Agneray committed
597
    public function setOutputCategory($outputCategory)
598
599
600
601
    {
        $this->outputCategory = $outputCategory;
    }

François Agneray's avatar
François Agneray committed
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
    public function jsonSerialize()
    {
        return [
            'id' => $this->getId(),
            'name' => $this->getName(),
            'table_name' => $this->getTableName(),
            'label' => $this->getLabel(),
            'form_label' => $this->getFormLabel(),
            'description' => $this->getDescription(),
            'output_display' => $this->getOutputDisplay(),
            'criteria_display' => $this->getCriteriaDisplay(),
            'search_flag' => $this->getSearchFlag(),
            'search_type' => $this->getSearchType(),
            'type' => $this->getType(),
            'operator' => $this->getOperator(),
            'min' => $this->getMin(),
            'max' => $this->getMax(),
            'placeholder_min' => $this->getPlaceholderMin(),
            'placeholder_max' => $this->getPlaceholderMax(),
            'uri_action' => $this->getUriAction(),
            'renderer' => $this->getRenderer(),
            'display_detail' => $this->getDisplayDetail(),
            'selected' => $this->getSelected(),
            'order_by' => $this->getOrderBy(),
            'order_display' => $this->getOrderDisplay(),
            'detail' => $this->getDetail(),
            'renderer_detail' => $this->getRendererDetail(),
629
            'options' => $this->getOptions(),
François Agneray's avatar
François Agneray committed
630
631
632
633
634
635
            'vo_utype' => $this->getVoUtype(),
            'vo_ucd' => $this->getVoUcd(),
            'vo_unit' => $this->getVoUnit(),
            'vo_description' => $this->getVoDescription(),
            'vo_datatype' => $this->getVoDatatype(),
            'vo_size' => $this->getVoSize(),
636
637
            'id_criteria_family' => is_null($this->getCriteriaFamily()) ? null : $this->getCriteriaFamily()->getId(),
            'id_output_category' => is_null($this->getOutputCategory()) ? null : $this->getOutputCategory()->getId()
François Agneray's avatar
François Agneray committed
638
639
640
        ];
    }
}