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

ModelAwareTrait::setModel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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