Completed
Push — master ( bfe64f...050f53 )
by Dmitry
02:12
created

Entity   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 4
c 2
b 0
f 1
lcom 1
cbo 1
dl 0
loc 26
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getRepository() 0 4 1
A save() 0 4 1
A __debugInfo() 0 6 1
1
<?php
2
3
namespace Tarantool\Mapper;
4
5
class Entity
6
{
7
    private $_repository;
8
9
    public function __construct(Repository $repository)
10
    {
11
        $this->_repository = $repository;
12
    }
13
14
    public function getRepository()
15
    {
16
        return $this->_repository;
17
    }
18
19
    public function save()
20
    {
21
        $this->getRepository()->save($this);
22
    }
23
24
    public function __debugInfo()
25
    {
26
        $info = get_object_vars($this);
27
        unset($info['_repository']);
28
        return $info;
29
    }
30
}
31