UserObject   A
last analyzed

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
10
namespace Transfer\EzPlatform\Repository\Values;
11
12
use Transfer\EzPlatform\Repository\Values\Mapper\UserMapper;
13
14
/**
15
 * User object.
16
 *
17
 * @see http://transfer-framework.com/docs/1.0/sources_and_targets/ezplatform/the_objects/userobject.html
18
 */
19
class UserObject extends EzPlatformObject
20
{
21
    /**
22
     * @var UserMapper
23
     */
24
    protected $mapper;
25
26
    /**
27
     * @return UserMapper
28 10
     */
29
    public function getMapper()
30 10
    {
31 10
        if (!$this->mapper) {
32 10
            $this->mapper = new UserMapper($this);
33
        }
34 10
35
        return $this->mapper;
36
    }
37
38
    /**
39
     * Allows direct control in UserCreateStruct and UserUpdateStruct.
40
     *
41
     * @param \Closure $callback
42 1
     */
43
    public function setStructCallback(\Closure $callback)
44 1
    {
45 1
        $this->setProperty('struct_callback', $callback);
46
    }
47
}
48