Completed
Push — master ( af7add...6e606c )
by Karsten
02:11
created

PropertyMappingMarkerBase   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 41
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 4 1
A hasAlias() 0 4 1
A keepNullValuesInCollections() 0 4 1
A getAlias() 0 4 1
1
<?php
2
/**
3
 * File was created 30.09.2015 17:51
4
 */
5
6
namespace PeekAndPoke\Component\Slumber\Annotation\Slumber;
7
8
use PeekAndPoke\Component\Slumber\Annotation\PropertyMappingMarker;
9
use PeekAndPoke\Component\Slumber\Annotation\SlumberAnnotation;
10
11
/**
12
 * @author Karsten J. Gerber <[email protected]>
13
 */
14
abstract class PropertyMappingMarkerBase extends SlumberAnnotation implements PropertyMappingMarker
15
{
16
    /**
17
     * Set an alias for this field. The alias will be used for storing the value in the database.
18
     *
19
     * @var string
20
     */
21
    public $alias;
22
23
    /**
24
     * @return string
25
     */
26 46
    public function getValue()
27
    {
28 46
        return $this->value;
29
    }
30
31
    /**
32
     * @return string
33
     */
34 10
    public function getAlias()
35
    {
36 10
        return $this->alias;
37
    }
38
39
    /**
40
     * @return bool
41
     */
42 36
    public function hasAlias()
43
    {
44 36
        return ! empty($this->alias);
45
    }
46
47
    /**
48
     * @return bool
49
     */
50 48
    public function keepNullValuesInCollections()
51
    {
52 48
        return true;
53
    }
54
}
55