Completed
Push — master ( 22ba15...552305 )
by Jean-Christophe
03:10
created

HtmlFormTextarea   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 2
A setRows() 0 3 1
A getDataField() 0 3 1
A setName() 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
30
	public function setName($name){
31
		$this->getDataField()->setProperty("name",$name);
32
	}
33
}