Common::getConstraint()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * The common part of each element in a form
5
 *
6
 * @category  	lib
7
 * @package		lib\Form
8
 * @author    	Judicaël Paquet <[email protected]>
9
 * @copyright 	Copyright (c) 2013-2014 PAQUET Judicaël FR Inc. (https://github.com/las93)
10
 * @license   	https://github.com/las93/venus2/blob/master/LICENSE.md Tout droit réservé à PAQUET Judicaël
11
 * @version   	Release: 1.0.0
12
 * @filesource	https://github.com/las93/venus2
13
 * @link      	https://github.com/las93
14
 * @since     	1.0
15
 */
16
namespace Venus\lib\Form;
17
18
/**
19
 * The common part of each element in a form
20
 *
21
 * @category  	lib
22
 * @package		lib\Form
23
 * @author    	Judicaël Paquet <[email protected]>
24
 * @copyright 	Copyright (c) 2013-2014 PAQUET Judicaël FR Inc. (https://github.com/las93)
25
 * @license   	https://github.com/las93/venus2/blob/master/LICENSE.md Tout droit réservé à PAQUET Judicaël
26
 * @version   	Release: 1.0.0
27
 * @filesource	https://github.com/las93/venus2
28
 * @link      	https://github.com/las93
29
 * @since     	1.0
30
 */
31
abstract class Common
32
{
33
	/**
34
	 * the name of element
35
	 *
36
	 * @access private
37
	 * @var    string
38
	 */
39
	private $_sName = null;
40
	
41
	/**
42
	 * constraints on the element
43
	 *
44
	 * @access private
45
	 * @var    string
46
	 */
47
	private $_aConstraints = null;
48
49
	/**
50
	 * get the name
51
	 *
52
	 * @access public
53
	 * @return string
54
	 */
55
	public function getName() : string
56
	{
57
		return $this->_sName;
58
	}
59
60
	/**
61
	 * get the name
62
	 *
63
	 * @access public
64
	 * @param  string $sName name;
65
	 * @return object
66
	 */
67
	public function setName(string $sName)
68
	{
69
		$this->_sName = $sName;
70
		return $this;
71
	}
72
73
	/**
74
	 * get the <html>
75
	 *
76
	 * @access public
77
	 * @return string
78
	 */
79
	abstract public function fetch() : string;
80
81
	/**
82
	 * set the constraint
83
	 *
84
	 * @access public
85
	 * @param  object $oConstraint constraint;
86
	 * @return object
87
	 */
88
	public function setConstraint($oConstraint)
89
	{
90
		$this->_aConstraints[] = $oConstraint;
91
		return $this;
92
	}
93
94
	/**
95
	 * get the constraint
96
	 *
97
	 * @access public
98
	 * @return array
99
	 */
100
	public function getConstraint() : array
101
	{
102
		return $this->_aConstraints;
103
	}
104
}
105