Completed
Push — master ( 0661db...c488b0 )
by Peter
12:28
created

EmbedRefDecorator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 4
dl 0
loc 12
ccs 0
cts 3
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getClassName() 0 7 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 http://maslosoft.com/mangan/
12
 */
13
14
namespace Maslosoft\Mangan\Decorators;
15
16
use Maslosoft\Mangan\Meta\DocumentPropertyMeta;
17
use Maslosoft\Mangan\Meta\ManganMeta;
18
19
/**
20
 * Embed Ref Decorator is alias for embedded decorator for converting
21
 * Db Refs into JSON arrays, Document arrays etc.
22
 *
23
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
24
 */
25
class EmbedRefDecorator extends EmbeddedDecorator
26
{
27
28
	protected static function getClassName($model, $name)
29
	{
30
		$fieldMeta = ManganMeta::create($model)->$name;
31
32
		/* @var $fieldMeta DocumentPropertyMeta */
33
		return $fieldMeta->dbRef->class;
34
	}
35
36
}
37