Passed
Push — master ( 919ce4...d1101e )
by Michael
03:15 queued 11s
created

Type::getGroupsModeration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
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
/**
18
 * Module: Adslight
19
 *
20
 * @category        Module
21
 * @package         adslight
22
 * @author          XOOPS Development Team <https://xoops.org>
23
 * @copyright       {@link https://xoops.org/ XOOPS Project}
24
 * @license         GPL 2.0 or later
25
 * @link            https://xoops.org/
26
 * @since           1.0.0
27
 */
28
29
use Xmf\Module\Helper\Permission;
30
use XoopsModules\Adslight\{
31
    Form\TypeForm
32
};
33
34
//$permHelper = new \Xmf\Module\Helper\Permission();
35
36
/**
37
 * Class Type
38
 */
39
class Type extends \XoopsObject
40
{
41
    public $helper;
42
43
    public $permHelper;
44
45
    /**
46
     * Constructor
47
     *
48
     * @param null
49
     */
50
    public function __construct()
51
    {
52
        parent::__construct();
53
        /** @var Helper $helper */
54
        $this->helper = Helper::getInstance();
55
        $this->permHelper = new Permission();
56
        $this->initVar('id_type', \XOBJ_DTYPE_INT);
57
        $this->initVar('nom_type', \XOBJ_DTYPE_TXTBOX);
58
    }
59
60
    /**
61
     * Get form
62
     */
63
    public function getForm(): TypeForm
64
    {
65
        return new TypeForm($this);
66
    }
67
68
69
    public function getGroupsRead(): ?array
70
    {
71
        //$permHelper = new \Xmf\Module\Helper\Permission();
72
        return $this->permHelper->getGroupsForItem(
73
            'sbcolumns_read',
74
            $this->getVar('id_type')
75
        );
76
    }
77
78
79
    public function getGroupsSubmit(): ?array
80
    {
81
        //$permHelper = new \Xmf\Module\Helper\Permission();
82
        return $this->permHelper->getGroupsForItem(
83
            'sbcolumns_submit',
84
            $this->getVar('id_type')
85
        );
86
    }
87
88
89
    public function getGroupsModeration(): ?array
90
    {
91
        //$permHelper = new \Xmf\Module\Helper\Permission();
92
        return $this->permHelper->getGroupsForItem(
93
            'sbcolumns_moderation',
94
            $this->getVar('id_type')
95
        );
96
    }
97
}
98