Completed
Push — master ( 848ec5...d8452d )
by Jean-Christophe
02:59
created

HtmlFormTextarea   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 1
cbo 3
dl 0
loc 21
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 2
A setRows() 0 3 1
A getDataField() 0 3 1
1
<?php
2
3
namespace Ajax\semantic\html\collections\form;
4
5
use Ajax\semantic\html\collections\form\HtmlFormField;
6
use Ajax\common\html\html5\HtmlTextarea;
7
use Ajax\semantic\html\collections\form\traits\TextFieldsTrait;
8
9
class HtmlFormTextarea extends HtmlFormField {
10
	use TextFieldsTrait;
11
12
	public function __construct($identifier, $label=NULL,$value=NULL,$placeholder=NULL,$rows=NULL) {
13
		if(!isset($placeholder))
14
			$placeholder=$label;
15
		parent::__construct("field-".$identifier, new HtmlTextarea($identifier,$value,$placeholder,$rows), $label);
16
	}
17
18
	/**
19
	 * Defines the textarea row count
20
	 * @param int $count
21
	 */
22
	public function setRows($count){
23
		$this->getField()->setRows($count);
24
	}
25
26
	public function getDataField() {
27
		return $this->content["field"];
28
	}
29
}