Completed
Push — master ( 3555a5...e61355 )
by Jean-Christophe
03:33
created

Widget::getInstanceViewer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Ajax\common;
4
5
use Ajax\common\html\HtmlDoubleElement;
6
7
abstract class Widget extends HtmlDoubleElement {
8
9
	protected $_model;
10
	protected $_modelInstance;
11
	protected $_instanceViewer;
12
13
	public function __construct($identifier,$model,$modelInstance=NULL) {
14
		parent::__construct($identifier);
15
		$this->_template="%wrapContentBefore%%content%%wrapContentAfter%";
16
		$this->setModel($model);
17
		if(isset($modelInstance));
18
			$this->show($modelInstance);
19
	}
20
21
	public function show($modelInstance){
22
		$this->_modelInstance=$modelInstance;
23
	}
24
25
	public function getModel() {
26
		return $this->_model;
27
	}
28
29
	public function setModel($_model) {
30
		$this->_model=$_model;
31
		return $this;
32
	}
33
34
	public function getInstanceViewer() {
35
		return $this->_instanceViewer;
36
	}
37
38
	public function setInstanceViewer($_instanceViewer) {
39
		$this->_instanceViewer=$_instanceViewer;
40
		return $this;
41
	}
42
43
	public abstract function getHtmlComponent();
0 ignored issues
show
Coding Style introduced by
The abstract declaration must precede the visibility declaration
Loading history...
44
45
	public function setColor($color){
46
		return $this->getHtmlComponent()->setColor($color);
47
	}
48
}