Test Setup Failed
Pull Request — master (#190)
by
unknown
17:12
created

privilege   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 9 1
A save() 0 9 1
1
<?php
2
/**
3
 * @copyright CONTENT CONTROL GmbH, http://www.contentcontrol-berlin.de
4
 */
5
6
namespace midcom\datamanager\storage;
7
8
/**
9
 * Experimental storage class
10
 */
11
class privilege extends delayed
12
{
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function load()
17
    {
18
        $source = $this->object->get_privilege(
19
            $this->config['type_config']['privilege_name'],
20
            $this->config['type_config']['assignee'],
21
            $this->config['type_config']['classname']
22
        );
23
        return $source->value;
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function save()
30
    {
31
        return $this->object->set_privilege(
32
            $this->config['type_config']['privilege_name'],
33
            $this->config['type_config']['assignee'],
34
            $this->value,
35
            $this->config['type_config']['classname']
36
        );
37
    }
38
}