CriteriaFamily.php 1.65 KB
Newer Older
1
<?php declare(strict_types=1);
François Agneray's avatar
François Agneray committed
2
3
4
5
6
7
8
9
10
/*
 * This file is part of ANIS SERVER API.
 *
 * (c) François Agneray <francois.agneray@lam.fr>
 * (c) Chrystel Moreau <chrystel.moreau@lam.fr>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
11
namespace App\Entity\Metamodel;
François Agneray's avatar
François Agneray committed
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

/**
* @Entity
* @Table(name="criteria_family")
*/
class CriteriaFamily implements \JsonSerializable
{
    /**
     * @var integer
     *
     * @Id
     * @Column(type="integer", nullable=false)
     * @GeneratedValue
     */
    protected $id;
  
    /**
     * @var string
     *
     * @Column(type="string", nullable=false)
     */
    protected $label;

35
36
    /**
     * @var integer
François Agneray's avatar
François Agneray committed
37
     *
38
39
40
41
42
43
44
45
46
47
48
     * @Column(type="integer", nullable=false)
     */
    protected $display;

    /**
     * @var Anis\Entity\Attribute[]
     *
     * @OneToMany(targetEntity="Attribute", mappedBy="criteriaFamily")
     */
    protected $attributes;

François Agneray's avatar
François Agneray committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
    public function getId()
    {
        return $this->id;
    }
  
    public function getLabel()
    {
        return $this->label;
    }
  
    public function setLabel($label)
    {
        $this->label = $label;
    }

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
    public function getDisplay()
    {
        return $this->display;
    }

    public function setDisplay($display)
    {
        $this->display = $display;
    }

    public function getAttributes()
    {
        return $this->attributes;
    }

François Agneray's avatar
François Agneray committed
79
80
81
82
83
    public function jsonSerialize()
    {
        return [
            'id' => $this->getId(),
            'label' => $this->getLabel(),
84
            'display' => $this->getDisplay(),
François Agneray's avatar
François Agneray committed
85
86
87
88
            'type' => 'criteria'
        ];
    }
}