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

ModelAwareTrait::getModel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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