Completed
Push — master ( 144202...6a00f8 )
by Peter
11:59
created

ModelAwareTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 40%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 31
ccs 2
cts 5
cp 0.4
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getModel() 0 4 1
A setModel() 0 5 1
1
<?php
2
3
/*
4
 * To change this license header, choose License Headers in Project Properties.
5
 * To change this template file, choose Tools | Templates
6
 * and open the template in the editor.
7
 */
8
9
namespace Maslosoft\Mangan\Traits;
10
11
use Maslosoft\Addendum\Interfaces\AnnotatedInterface;
12
13
/**
14
 * ModelAwareTrait
15
 *
16
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
17
 */
18
trait ModelAwareTrait
19
{
20
21
	/**
22
	 * Instance of model
23
	 * @var AnnotatedInterface
24
	 * @since v1.0
25
	 */
26
	public $model;
27
28
	/**
29
	 * Get model used by this data provider
30
	 * @return AnnotatedInterface
31
	 */
32 1
	public function getModel()
33
	{
34 1
		return $this->model;
35
	}
36
37
	/**
38
	 * Set model
39
	 * @param AnnotatedInterface $model
40
	 * @return static
41
	 */
42
	public function setModel(AnnotatedInterface $model)
43
	{
44
		$this->model = $model;
45
		return $this;
46
	}
47
48
}
49