Completed
Push — master ( edce3c...0ce30f )
by
unknown
15:59
created

FrontendUserGroup::getLockToDomain()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the TYPO3 CMS project.
5
 *
6
 * It is free software; you can redistribute it and/or modify it under
7
 * the terms of the GNU General Public License, either version 2
8
 * of the License, or any later version.
9
 *
10
 * For the full copyright and license information, please read the
11
 * LICENSE.txt file that was distributed with this source code.
12
 *
13
 * The TYPO3 project - inspiring people to share!
14
 */
15
16
namespace TYPO3\CMS\Extbase\Domain\Model;
17
18
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
19
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
20
21
/**
22
 * A Frontend User Group
23
 */
24
class FrontendUserGroup extends AbstractEntity
25
{
26
    /**
27
     * @var string
28
     */
29
    protected $title = '';
30
31
    /**
32
     * @var string
33
     */
34
    protected $description = '';
35
36
    /**
37
     * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup>
38
     */
39
    protected $subgroup;
40
41
    /**
42
     * Constructs a new Frontend User Group
43
     *
44
     * @param string $title
45
     */
46
    public function __construct($title = '')
47
    {
48
        $this->setTitle($title);
49
        $this->subgroup = new ObjectStorage();
50
    }
51
52
    /**
53
     * Sets the title value
54
     *
55
     * @param string $title
56
     */
57
    public function setTitle($title)
58
    {
59
        $this->title = $title;
60
    }
61
62
    /**
63
     * Returns the title value
64
     *
65
     * @return string
66
     */
67
    public function getTitle()
68
    {
69
        return $this->title;
70
    }
71
72
    /**
73
     * Sets the description value
74
     *
75
     * @param string $description
76
     */
77
    public function setDescription($description)
78
    {
79
        $this->description = $description;
80
    }
81
82
    /**
83
     * Returns the description value
84
     *
85
     * @return string
86
     */
87
    public function getDescription()
88
    {
89
        return $this->description;
90
    }
91
92
    /**
93
     * Sets the subgroups. Keep in mind that the property is called "subgroup"
94
     * although it can hold several subgroups.
95
     *
96
     * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $subgroup An object storage containing the subgroups to add
97
     */
98
    public function setSubgroup(ObjectStorage $subgroup)
99
    {
100
        $this->subgroup = $subgroup;
101
    }
102
103
    /**
104
     * Adds a subgroup to the frontend user
105
     *
106
     * @param \TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup $subgroup
107
     */
108
    public function addSubgroup(\TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup $subgroup)
109
    {
110
        $this->subgroup->attach($subgroup);
111
    }
112
113
    /**
114
     * Removes a subgroup from the frontend user group
115
     *
116
     * @param \TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup $subgroup
117
     */
118
    public function removeSubgroup(\TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup $subgroup)
119
    {
120
        $this->subgroup->detach($subgroup);
121
    }
122
123
    /**
124
     * Returns the subgroups. Keep in mind that the property is called "subgroup"
125
     * although it can hold several subgroups.
126
     *
127
     * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage An object storage containing the subgroups
128
     */
129
    public function getSubgroup()
130
    {
131
        return $this->subgroup;
132
    }
133
}
134