AbstractCustomEntity   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 82
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1
Metric Value
wmc 7
lcom 0
cbo 1
dl 0
loc 82
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getReference() 0 4 1
A getCreated() 0 4 1
A getUpdated() 0 4 1
A setCreated() 0 6 1
A setUpdated() 0 6 1
getCustomEntityName() 0 1 ?
A getLabelProperty() 0 4 1
A getSortOrderColumn() 0 4 1
1
<?php
2
3
namespace Pim\Bundle\CustomEntityBundle\Entity;
4
5
use Pim\Component\ReferenceData\Model\AbstractReferenceData;
6
7
/**
8
 * @author    Antoine Guigan <[email protected]>
9
 * @copyright 2013 Akeneo SAS (http://www.akeneo.com)
10
 * @license   http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
11
 */
12
abstract class AbstractCustomEntity extends AbstractReferenceData
13
{
14
    /** @var \DateTime */
15
    protected $created;
16
17
    /** @var \DateTime */
18
    protected $updated;
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function getReference()
24
    {
25
        return $this->code;
26
    }
27
28
    /**
29
     * @return \DateTime
30
     */
31
    public function getCreated()
32
    {
33
        return $this->created;
34
    }
35
36
    /**
37
     * @return \DateTime
38
     */
39
    public function getUpdated()
40
    {
41
        return $this->updated;
42
    }
43
44
    /**
45
     * @param \DateTime $created
46
     *
47
     * @return AbstractCustomEntity
48
     */
49
    public function setCreated(\DateTime $created)
50
    {
51
        $this->created = $created;
52
53
        return $this;
54
    }
55
56
    /**
57
     * @param \DateTime $updated
58
     *
59
     * @return AbstractCustomEntity
60
     */
61
    public function setUpdated(\DateTime $updated)
62
    {
63
        $this->updated = $updated;
64
65
        return $this;
66
    }
67
68
    /**
69
     * Returns the custom entity name used in the configuration
70
     * Used to map row actions on datagrid
71
     *
72
     * @return string
73
     */
74
    abstract public function getCustomEntityName();
75
76
    /**
77
     * {@inheritdoc}
78
     */
79
    public static function getLabelProperty()
80
    {
81
        return 'code';
82
    }
83
84
    /**
85
     * Returns the sort order
86
     *
87
     * @return string
88
     */
89
    public static function getSortOrderColumn()
90
    {
91
        return 'code';
92
    }
93
}
94