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

privilege::save()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
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
}