Completed
Push — 1.0 ( 747417...ecc1b0 )
by Valentin
10:58 queued 04:14
created

UserObject::__construct()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
ccs 8
cts 8
cp 1
rs 9.4285
cc 3
eloc 6
nc 4
nop 2
crap 3
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
16
** Available keys: **
17
18
    $parents = Transfer\EzPlatform\Data\UserGroupObject[]
19
    $data = [
20
        username => string
21
        email => string
22
        password => string
23
        main_language_code => string
24
        enabled => bool
25
        max_login => int
26
        fields => [ first_name => string
27
                    last_name => string
28
                    ...                 ]
29
    ],
30
    $properties = [
31
        action => int {@link see \Transfer\EzPlatform\Data\Action\Enum\Action}
32
    ]
33
34
35
** Required on `create`:
36
**** Required by transfer:
37
    `username´
38
    `email`
39
    `password`
40
41
**** Required by eZ:
42
    `username´
43
    `èmail`
44
    `password`
45
    `main_language_code`
46
    And any required fields in `fields`
47
48
** Required on `update`:
49
**** Required by transfer:
50
    `username`
51
52
**** Required by eZ:
53
    `username`
54
55
*/
56
57
/**
58
 * User object.
59
 */
60
class UserObject extends EzPlatformObject
61
{
62
    /**
63
     * @var UserMapper
64
     */
65
    protected $mapper;
66
67
    /**
68
     * @return UserMapper
69
     */
70 7
    public function getMapper()
71
    {
72 7
        if (!$this->mapper) {
73 7
            $this->mapper = new UserMapper($this);
74 7
        }
75
76 7
        return $this->mapper;
77
    }
78
}
79