Completed
Push — master ( 04bd65...4036d4 )
by Fran
09:06
created

Field::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
c 2
b 0
f 0
nc 1
nop 7
dl 0
loc 10
rs 9.4285
1
<?php
2
    namespace PSFS\base\dto;
3
4
    /**
5
     * Class Field
6
     * @package PSFS\base\dto
7
     */
8
    class Field extends Dto
9
    {
10
        const TEXT_TYPE = 'text';
11
        const PHONE_TYPE = 'tel';
12
        const URL_TYPE = 'url';
13
        const CHECK_TYPE = 'checkbox';
14
        const RADIO_TYPE = 'radio';
15
        const COMBO_TYPE = 'select';
16
        const TEXTAREA_TYPE = 'textarea';
17
        const SEARCH_TYPE = 'search';
18
        const HIDDEN_TYPE = 'hidden';
19
        const NUMBER_TYPE = 'number';
20
21
        /**
22
         * @var string label
23
         */
24
        public $label;
25
        /**
26
         * @var string name
27
         */
28
        public $name;
29
        /**
30
         * @var string type
31
         */
32
        public $type = Field::TEXT_TYPE;
33
        /**
34
         * @var array data
35
         */
36
        public $data = array();
37
        /**
38
         * @var string url
39
         */
40
        public $url;
41
        /**
42
         * @var Object value
43
         */
44
        public $value;
45
        /**
46
         * @var bool required
47
         */
48
        public $required = true;
49
        /**
50
         * @var string entity
51
         */
52
        public $entity;
53
54
        public function __construct($name, $label, $type = Field::TEXT_TYPE, $value = null, $data = array(), $url = null, $required = true)
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 139 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
55
        {
56
            $this->name = $name;
57
            $this->label = $label;
58
            $this->type = $type;
59
            $this->value = $value;
60
            $this->data = $data;
61
            $this->url = $url;
62
            $this->required = $required;
63
        }
64
    }