ModelAwareTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getModel() 0 4 1
A setModel() 0 5 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