forked from thoinv/forums
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Banning.php
59 lines (50 loc) · 1.5 KB
/
Banning.php
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
54
55
56
57
58
59
<?php
/**
* @package Nobita Social Groups Nulled by HQCoder
* @author Nobita
* @nuller Congngheaz
* @link http://www.congngheaz.com/forums/Xenforo-addon-nulled-free/
* @copyright (c) 2015 AZ Technologies, Inc. All rights reserved!
*/
/*====================================================================*\
|| ################################################################## ||
|| # Copyright 2015 AZ Technologies, Inc. # ||
|| # All Rights Reserved. # ||
|| ################################################################## ||
\*====================================================================*/
class Nobita_Teams_Banning
{
const BANNING_ID_KEY = 'banning_id';
protected $_data;
public function __construct(array $data)
{
$this->_data = $data;
}
public function getTeamId()
{
return isset($this->_data['team_id']) ? $this->_data['team_id'] : 0;
}
public function getUserId()
{
return isset($this->_data['user_id']) ? $this->_data['user_id'] : 0;
}
public static function generateBanningUniqueId(array &$data, $type)
{
$self = new self($data);
return $data['banningInfo'][self::BANNING_ID_KEY] = sprintf('%d_%s_%d',
$self->getTeamId(),
$type,
$self->getUserId()
);
}
public static function getBanningParamsFromData($data)
{
if (empty($data[self::BANNING_ID_KEY]))
{
return array();
}
$id = $data[self::BANNING_ID_KEY];
$parts = explode('_', $id);
return $parts;
}
}