Condition::getForm()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
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
29
//$permHelper = new \Xmf\Module\Helper\Permission();
30
31
/**
32
 * Class Condition
33
 */
34
class Condition extends \XoopsObject
35
{
36
    private $id_condition;
0 ignored issues
show
introduced by
The private property $id_condition is not used, and could be removed.
Loading history...
37
    private $nom_condition;
0 ignored issues
show
introduced by
The private property $nom_condition is not used, and could be removed.
Loading history...
38
    public  $helper;
39
    public  $permHelper;
40
41
    /**
42
     * Constructor
43
     *
44
     * @param null
45
     */
46
    public function __construct()
47
    {
48
        parent::__construct();
49
        // /** @var Adslight\Helper $helper */
50
        //        $this->helper = Adslight\Helper::getInstance();
51
        $this->permHelper = new \Xmf\Module\Helper\Permission();
52
53
        $this->initVar('id_condition', \XOBJ_DTYPE_INT);
54
        $this->initVar('nom_condition', \XOBJ_DTYPE_TXTBOX);
55
    }
56
57
    /**
58
     * Get form
59
     *
60
     * @param null
61
     * @return Form\ConditionForm
62
     */
63
    public function getForm(): Form\ConditionForm
64
    {
65
        $form = new Form\ConditionForm($this);
66
67
        return $form;
68
    }
69
70
    /**
71
     * @return array|null
72
     */
73
    public function getGroupsRead(): ?array
74
    {
75
        //$permHelper = new \Xmf\Module\Helper\Permission();
76
        return $this->permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('id_condition'));
77
    }
78
79
    /**
80
     * @return array|null
81
     */
82
    public function getGroupsSubmit(): ?array
83
    {
84
        //$permHelper = new \Xmf\Module\Helper\Permission();
85
        return $this->permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('id_condition'));
86
    }
87
88
    /**
89
     * @return array|null
90
     */
91
    public function getGroupsModeration(): ?array
92
    {
93
        //$permHelper = new \Xmf\Module\Helper\Permission();
94
        return $this->permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('id_condition'));
95
    }
96
}
97