Total Complexity | 7 |
Total Lines | 68 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php namespace Pz\Doctrine\Rest\Traits; |
||
6 | trait RelatedAction |
||
7 | { |
||
8 | /** |
||
9 | * @var RestRepository |
||
10 | */ |
||
11 | protected $related; |
||
12 | |||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $field; |
||
17 | |||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $mappedBy; |
||
22 | |||
23 | /** |
||
24 | * Related repository. |
||
25 | * |
||
26 | * @return RestRepository |
||
27 | */ |
||
28 | 7 | public function related() |
|
29 | { |
||
30 | 7 | return $this->related; |
|
31 | } |
||
32 | |||
33 | /** |
||
34 | * `field` on base entity that identify relation. |
||
35 | * |
||
36 | * @return string |
||
37 | */ |
||
38 | 10 | public function field() |
|
41 | } |
||
42 | |||
43 | /** |
||
44 | * @return string |
||
45 | */ |
||
46 | 5 | public function mappedBy() |
|
49 | } |
||
50 | |||
51 | /** |
||
52 | * @param $item |
||
53 | * |
||
54 | * @return null|object |
||
55 | * @throws RestException |
||
56 | */ |
||
57 | 7 | protected function getRelatedEntity($item) |
|
76 |