UserObject::getMapper()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 3
b 0
f 0
nc 2
nop 0
dl 0
loc 8
ccs 4
cts 4
cp 1
crap 2
rs 9.4285
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