Completed
Push — 1.0 ( fb098d...df18cb )
by Valentin
03:59
created

UserObject   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 3
c 4
b 0
f 0
lcom 1
cbo 2
dl 0
loc 29
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getMapper() 0 8 2
A setStructCallback() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of Transfer.
5
 *
6
 * For the full copyright and license information, please view the LICENSE file located
7
 * in the root directory.
8
 */
9
namespace Transfer\EzPlatform\Repository\Values;
10
11
use Transfer\EzPlatform\Repository\Values\Mapper\UserMapper;
12
13
/**
14
 * User object.
15
 *
16
 * @see http://transfer-framework.com/docs/1.0/sources_and_targets/ezplatform/the_objects/userobject.html
17
 */
18
class UserObject extends EzPlatformObject
19
{
20
    /**
21
     * @var UserMapper
22
     */
23
    protected $mapper;
24
25
    /**
26
     * @return UserMapper
27
     */
28 8
    public function getMapper()
29
    {
30 8
        if (!$this->mapper) {
31 8
            $this->mapper = new UserMapper($this);
32 8
        }
33
34 8
        return $this->mapper;
35
    }
36
37
    /**
38
     * Allows direct control in UserCreateStruct and UserUpdateStruct.
39
     *
40
     * @param \Closure $callback
41
     */
42 1
    public function setStructCallback(\Closure $callback)
43
    {
44 1
        $this->setProperty('struct_callback', $callback);
45 1
    }
46
}
47