ModelAwareTrait::getModel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * This software package is licensed under AGPL or Commercial license.
5
 *
6
 * @package maslosoft/mangan
7
 * @licence AGPL or Commercial
8
 * @copyright Copyright (c) Piotr Masełkowski <[email protected]>
9
 * @copyright Copyright (c) Maslosoft
10
 * @copyright Copyright (c) Others as mentioned in code
11
 * @link https://maslosoft.com/mangan/
12
 */
13
14
namespace Maslosoft\Mangan\Traits;
15
16
use Maslosoft\Addendum\Interfaces\AnnotatedInterface;
17
18
/**
19
 * ModelAwareTrait
20
 *
21
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
22
 */
23
trait ModelAwareTrait
24
{
25
26
	/**
27
	 * Instance of model
28
	 * @Ignored
29
	 * @Persistent(false)
30
	 * @var AnnotatedInterface
31
	 * @since v1.0
32
	 */
33
	public $model;
34
35
	/**
36
	 * Get model used by this data provider
37
	 * @Ignored
38
	 * @return AnnotatedInterface
39
	 */
40 135
	public function getModel()
41
	{
42 135
		return $this->model;
43
	}
44
45
	/**
46
	 * Set model
47
	 * @Ignored
48
	 * @param AnnotatedInterface $model
49
	 * @return static
50
	 */
51 140
	public function setModel(AnnotatedInterface $model)
52
	{
53 140
		$this->model = $model;
54 140
		return $this;
55
	}
56
57
}
58