Completed
Push — master ( 2181b4...d46ac5 )
by Oscar
03:08
created

AbstractEntity::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
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 $admin;
13
    protected $name;
14
15
    public $title;
16
    public $description;
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function __construct($name, Admin $admin)
22
    {
23
        $this->admin = $admin;
24
        $this->name = $name;
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function getName()
31
    {
32
        return $this->name;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function getLabel($id, array $data)
39
    {
40
        return current($data);
41
    }
42
}
43