Replies::getGroupsSubmit()   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 Replies
32
 */
33
class Replies extends \XoopsObject
34
{
35
    private $r_lid;
0 ignored issues
show
introduced by
The private property $r_lid is not used, and could be removed.
Loading history...
36
    private $lid;
0 ignored issues
show
introduced by
The private property $lid is not used, and could be removed.
Loading history...
37
    private $title;
0 ignored issues
show
introduced by
The private property $title is not used, and could be removed.
Loading history...
38
    private $date;
0 ignored issues
show
introduced by
The private property $date is not used, and could be removed.
Loading history...
39
    private $submitter;
0 ignored issues
show
introduced by
The private property $submitter is not used, and could be removed.
Loading history...
40
    private $message;
0 ignored issues
show
introduced by
The private property $message is not used, and could be removed.
Loading history...
41
    private $tele;
0 ignored issues
show
introduced by
The private property $tele is not used, and could be removed.
Loading history...
42
    private $email;
0 ignored issues
show
introduced by
The private property $email is not used, and could be removed.
Loading history...
43
    private $r_usid;
0 ignored issues
show
introduced by
The private property $r_usid is not used, and could be removed.
Loading history...
44
    public  $helper;
45
    public  $permHelper;
46
47
    /**
48
     * Constructor
49
     *
50
     * @param null
51
     */
52
    public function __construct()
53
    {
54
        parent::__construct();
55
        // /** @var Adslight\Helper $helper */
56
        //        $this->helper = Adslight\Helper::getInstance();
57
        $this->permHelper = new \Xmf\Module\Helper\Permission();
58
59
        $this->initVar('r_lid', \XOBJ_DTYPE_INT);
60
        $this->initVar('lid', \XOBJ_DTYPE_INT);
61
        $this->initVar('title', \XOBJ_DTYPE_TXTBOX);
62
        $this->initVar('date', \XOBJ_DTYPE_INT);
63
        $this->initVar('submitter', \XOBJ_DTYPE_TXTBOX);
64
        $this->initVar('message', \XOBJ_DTYPE_OTHER);
65
        $this->initVar('tele', \XOBJ_DTYPE_TXTBOX);
66
        $this->initVar('email', \XOBJ_DTYPE_TXTBOX);
67
        $this->initVar('r_usid', \XOBJ_DTYPE_INT);
68
    }
69
70
    /**
71
     * Get form
72
     *
73
     * @param null
74
     * @return Form\RepliesForm
75
     */
76
    public function getForm(): Form\RepliesForm
77
    {
78
        $form = new Form\RepliesForm($this);
79
80
        return $form;
81
    }
82
83
    /**
84
     * @return array|null
85
     */
86
    public function getGroupsRead(): ?array
87
    {
88
        //$permHelper = new \Xmf\Module\Helper\Permission();
89
        return $this->permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('r_lid'));
90
    }
91
92
    /**
93
     * @return array|null
94
     */
95
    public function getGroupsSubmit(): ?array
96
    {
97
        //$permHelper = new \Xmf\Module\Helper\Permission();
98
        return $this->permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('r_lid'));
99
    }
100
101
    /**
102
     * @return array|null
103
     */
104
    public function getGroupsModeration(): ?array
105
    {
106
        //$permHelper = new \Xmf\Module\Helper\Permission();
107
        return $this->permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('r_lid'));
108
    }
109
}
110