-
Notifications
You must be signed in to change notification settings - Fork 148
Expand file tree
/
Copy pathUserGroupAssignment.class.php
More file actions
53 lines (48 loc) · 1.7 KB
/
UserGroupAssignment.class.php
File metadata and controls
53 lines (48 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace wcf\data\user\group\assignment;
use wcf\data\DatabaseObject;
use wcf\data\user\group\UserGroup;
use wcf\system\request\IRouteController;
use wcf\util\JSON;
/**
* Represents an automatic assignment to a user group.
*
* @author Matthias Schmidt
* @copyright 2001-2019 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
*
* @property-read int $assignmentID unique id of the automatic user group assignment
* @property-read int $groupID id of the user group to which users are automatically assigned
* @property-read string $title title of the automatic user group assignment
* @property-read int $isDisabled is `1` if the user group assignment is disabled and thus not checked for automatic assignments, otherwise `0`
* @property-read string $conditions JSON-encoded string containing the conditions of the automatic user group assignment
* @property-read bool $isLegacy indicates whether the conditions need to be migrated to the new format
*/
class UserGroupAssignment extends DatabaseObject implements IRouteController
{
/**
* Returns the conditions of the automatic assignment to a user group.
*
* @return array{identifier: string, value: mixed}[]
*/
public function getConditions(): array
{
return JSON::decode($this->conditions);
}
/**
* @inheritDoc
*/
public function getTitle(): string
{
return $this->title;
}
/**
* Returns the user group the automatic assignment belongs to.
*
* @return UserGroup
*/
public function getUserGroup()
{
return UserGroup::getGroupByID($this->groupID);
}
}