Completed
Push — master ( 40080a...3f2ff8 )
by Jean-Christophe
04:12 queued 01:14
created

Widget::setModel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Ajax\common;
4
5
use Ajax\common\html\HtmlDoubleElement;
6
7
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
}