Uservotes::getGroupsRead()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php declare(strict_types=1);
2
3
namespace XoopsModules\Adslight;
4
5
/*
6
 You may not change or alter any portion of this comment or credits
7
 of supporting developers from this source code or any supporting source code
8
 which is considered copyrighted (c) material of the original comment or credit authors.
9
10
 This program is distributed in the hope that it will be useful,
11
 but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
*/
14
15
/**
16
 * Module: Adslight
17
 *
18
 * @category        Module
19
 * @author          XOOPS Development Team <https://xoops.org>
20
 * @copyright       {@link https://xoops.org/ XOOPS Project}
21
 * @license         GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)
22
 */
23
24
use XoopsModules\Adslight\{
25
    Form
26
};
27
28
//$permHelper = new \Xmf\Module\Helper\Permission();
29
30
/**
31
 * Class Uservotes
32
 */
33
class Uservotes extends \XoopsObject
34
{
35
    private $ratingid;
0 ignored issues
show
introduced by
The private property $ratingid is not used, and could be removed.
Loading history...
36
    private $usid;
0 ignored issues
show
introduced by
The private property $usid is not used, and could be removed.
Loading history...
37
    private $ratinguser;
0 ignored issues
show
introduced by
The private property $ratinguser is not used, and could be removed.
Loading history...
38
    private $rating;
0 ignored issues
show
introduced by
The private property $rating is not used, and could be removed.
Loading history...
39
    private $ratinghostname;
0 ignored issues
show
introduced by
The private property $ratinghostname is not used, and could be removed.
Loading history...
40
    private $ratingtimestamp;
0 ignored issues
show
introduced by
The private property $ratingtimestamp is not used, and could be removed.
Loading history...
41
42
    public $helper;
43
    public $permHelper;
44
45
    /**
46
     * Constructor
47
     *
48
     * @param null
49
     */
50
    public function __construct()
51
    {
52
        parent::__construct();
53
        // /** @var Adslight\Helper $helper */
54
        //        $this->helper = Adslight\Helper::getInstance();
55
        $this->permHelper = new \Xmf\Module\Helper\Permission();
56
57
        $this->initVar('ratingid', \XOBJ_DTYPE_INT);
58
        $this->initVar('usid', \XOBJ_DTYPE_INT);
59
        $this->initVar('ratinguser', \XOBJ_DTYPE_INT);
60
        $this->initVar('rating', \XOBJ_DTYPE_INT);
61
        $this->initVar('ratinghostname', \XOBJ_DTYPE_TXTBOX);
62
        $this->initVar('ratingtimestamp', \XOBJ_DTYPE_INT);
63
    }
64
65
    /**
66
     * Get form
67
     *
68
     * @param null
69
     * @return Form\UservotesForm
70
     */
71
    public function getForm(): Form\UservotesForm
72
    {
73
        $form = new Form\UservotesForm($this);
74
75
        return $form;
76
    }
77
78
    /**
79
     * @return array|null
80
     */
81
    public function getGroupsRead(): ?array
82
    {
83
        //$permHelper = new \Xmf\Module\Helper\Permission();
84
        return $this->permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('ratingid'));
85
    }
86
87
    /**
88
     * @return array|null
89
     */
90
    public function getGroupsSubmit(): ?array
91
    {
92
        //$permHelper = new \Xmf\Module\Helper\Permission();
93
        return $this->permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('ratingid'));
94
    }
95
96
    /**
97
     * @return array|null
98
     */
99
    public function getGroupsModeration(): ?array
100
    {
101
        //$permHelper = new \Xmf\Module\Helper\Permission();
102
        return $this->permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('ratingid'));
103
    }
104
}
105