Passed
Push — master ( 6af1fb...f5fe55 )
by Michael
02:53 queued 10s
created

Replies   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 18
c 1
b 0
f 0
dl 0
loc 63
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 1
A getGroupsRead() 0 4 1
A getForm() 0 4 1
A getGroupsSubmit() 0 4 1
A getGroupsModeration() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace XoopsModules\Adslight;
6
7
/*
8
 You may not change or alter any portion of this comment or credits
9
 of supporting developers from this source code or any supporting source code
10
 which is considered copyrighted (c) material of the original comment or credit authors.
11
 
12
 This program is distributed in the hope that it will be useful,
13
 but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
*/
16
/**
17
 * Module: Adslight
18
 *
19
 * @category        Module
20
 * @author          XOOPS Development Team <https://xoops.org>
21
 * @copyright       {@link https://xoops.org/ XOOPS Project}
22
 * @license         GPL 2.0 or later
23
 */
24
25
use XoopsModules\Adslight;
26
use XoopsModules\Adslight\Form;
27
28
//$permHelper = new \Xmf\Module\Helper\Permission();
29
30
31
/**
32
 * Class Replies
33
 */
34
class Replies extends \XoopsObject
35
{
36
    public $helper, $permHelper;
37
    /**
38
     * Constructor
39
     *
40
     * @param null
41
     */
42
    public function __construct()
43
    {
44
        parent::__construct();
45
//        /** @var  Adslight\Helper $helper */
46
//        $this->helper = Adslight\Helper::getInstance();
47
         $this->permHelper = new \Xmf\Module\Helper\Permission();
48
49
        $this->initVar('r_lid', XOBJ_DTYPE_INT);
50
        $this->initVar('lid', XOBJ_DTYPE_INT);
51
        $this->initVar('title', XOBJ_DTYPE_TXTBOX);
52
        $this->initVar('date', XOBJ_DTYPE_INT);
53
        $this->initVar('submitter', XOBJ_DTYPE_TXTBOX);
54
        $this->initVar('message', XOBJ_DTYPE_OTHER);
55
        $this->initVar('tele', XOBJ_DTYPE_TXTBOX);
56
        $this->initVar('email', XOBJ_DTYPE_TXTBOX);
57
        $this->initVar('r_usid', XOBJ_DTYPE_INT);
58
     }
59
60
    /**
61
     * Get form
62
     *
63
     * @param null
64
     * @return Adslight\Form\RepliesForm
65
     */
66
    public function getForm()
67
    {
68
        $form = new Form\RepliesForm($this);
69
        return $form;
70
    }
71
72
        /**
73
     * @return array|null
74
     */
75
    public function getGroupsRead()
76
    {
77
        //$permHelper = new \Xmf\Module\Helper\Permission();
78
        return $this->permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('r_lid'));
79
    }
80
81
    /**
82
     * @return array|null
83
     */
84
    public function getGroupsSubmit()
85
    {
86
          //$permHelper = new \Xmf\Module\Helper\Permission();
87
          return $this->permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('r_lid'));
88
    }
89
90
    /**
91
     * @return array|null
92
     */
93
    public function getGroupsModeration()
94
    {
95
        //$permHelper = new \Xmf\Module\Helper\Permission();
96
        return $this->permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('r_lid'));
97
    }
98
}
99
100