Completed
Push — feature/other-validation ( d247e5...dd9a82 )
by Narcotic
17:32 queued 11:47
created

AbstractField::getFormName()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
ccs 0
cts 7
cp 0
cc 3
eloc 7
nc 3
nop 0
crap 12
1
<?php
2
/**
3
 * AbstractField class file
4
 */
5
6
namespace Graviton\DocumentBundle\DependencyInjection\Compiler\Utils;
7
8
/**
9
 * Base document field
10
 *
11
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
12
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
13
 * @link     http://swisscom.ch
14
 */
15
class AbstractField
16
{
17
    /**
18
     * @var string
19
     */
20
    private $fieldName;
21
    /**
22
     * @var string
23
     */
24
    private $exposedName;
25
    /**
26
     * @var bool
27
     */
28
    private $readOnly;
29
    /**
30
     * @var bool
31
     */
32
    private $required;
33
    /**
34
     * @var bool
35
     */
36
    private $searchable;
37
38
    /**
39
     * Constructor
40
     *
41
     * @param string $fieldName   Field name
42
     * @param string $exposedName Exposed name
43
     * @param bool   $readOnly    Read only
44
     * @param bool   $required    Is required
45
     * @param bool   $searchable  Is searchable
46
     */
47 10
    public function __construct($fieldName, $exposedName, $readOnly, $required, $searchable)
48
    {
49 10
        $this->fieldName = $fieldName;
50 10
        $this->exposedName = $exposedName;
51 10
        $this->readOnly = $readOnly;
52 10
        $this->required = $required;
53 10
        $this->searchable = $searchable;
54 10
    }
55
56
    /**
57
     * Get field name
58
     *
59
     * @return string
60
     */
61 8
    public function getFieldName()
62
    {
63 8
        return $this->fieldName;
64
    }
65
66
    /**
67
     * Get exposed name
68
     *
69
     * @return string
70
     */
71 10
    public function getExposedName()
72
    {
73 10
        return $this->exposedName;
74
    }
75
76
    /**
77
     * Is read only
78
     *
79
     * @return bool
80
     */
81 2
    public function isReadOnly()
82
    {
83 2
        return $this->readOnly;
84
    }
85
86
    /**
87
     * Is required
88
     *
89
     * @return bool
90
     */
91
    public function isRequired()
92
    {
93
        return $this->required;
94
    }
95
96
    /**
97
     * Is searchable
98
     *
99
     * @return boolean
100
     */
101
    public function isSearchable()
102
    {
103
        return $this->searchable;
104
    }
105
106
    /**
107
     * @param boolean $searchable Is searchable
108
     *
109
     * @return void
110
     */
111
    public function setSearchable($searchable)
112
    {
113
        $this->searchable = $searchable;
114
    }
115
}
116