Completed
Push — 1.0 ( 19670d...450ed0 )
by Valentin
09:36
created

UserGroupObject   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 6
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 39
ccs 17
cts 17
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 4
A getMapper() 0 8 2
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\Data;
11
12
use Transfer\Data\ValueObject;
13
use Transfer\EzPlatform\Repository\Content\UserGroupMapper;
14
15
/**
16
 * User Group object.
17
 */
18
class UserGroupObject extends ValueObject
19
{
20
    /**
21
     * @var UserGroupMapper
22
     */
23
    private $mapper;
24
25
    /**
26
     * UserGroupObject constructor.
27
     *
28
     * @param mixed $data
29
     * @param array $properties
30
     */
31 20
    public function __construct(array $data, array $properties = array())
32
    {
33 20
        if (!isset($data['parent_id'])) {
34 10
            $data['parent_id'] = 12;
35 10
        }
36 20
        if (!isset($data['main_language_code'])) {
37 10
            $data['main_language_code'] = 'eng-GB';
38 10
        }
39 20
        if (!isset($data['content_type_identifier'])) {
40 10
            $data['content_type_identifier'] = 'user_group';
41 10
        }
42 20
        parent::__construct($data, $properties);
43 20
    }
44
45
    /**
46
     * @return UserGroupMapper
47
     */
48 12
    public function getMapper()
49
    {
50 12
        if (!$this->mapper) {
51 12
            $this->mapper = new UserGroupMapper($this);
52 12
        }
53
54 12
        return $this->mapper;
55
    }
56
}
57