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

Widget   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 28
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
A show() 0 3 1
A getModel() 0 3 1
A setModel() 0 4 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
}