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

UserObject::setStructCallback()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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