Completed
Push — master ( 186b3d...aa0a8b )
by Oscar
03:51
created

AbstractEntity   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 41
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getName() 0 4 1
A getLabel() 0 4 1
A getNavigation() 0 3 1
1
<?php
2
3
namespace Folk\Entities;
4
5
use Folk\Admin;
6
7
/**
8
 * Base class extended by all entities.
9
 */
10
abstract class AbstractEntity implements EntityInterface
11
{
12
    protected $name;
13
    protected $admin;
14
15
    public $icon;
16
    public $title;
17
    public $description;
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function __construct($name, Admin $admin)
23
    {
24
        $this->name = $name;
25
        $this->admin = $admin;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function getName()
32
    {
33
        return $this->name;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function getLabel($id, array $data)
40
    {
41
        return current($data);
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getNavigation($id)
48
    {
49
    }
50
}
51