Servpart::getGroupsRead()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php namespace XoopsModules\Cardealer;
2
3
/*
4
 You may not change or alter any portion of this comment or credits
5
 of supporting developers from this source code or any supporting source code
6
 which is considered copyrighted (c) material of the original comment or credit authors.
7
8
 This program is distributed in the hope that it will be useful,
9
 but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
*/
12
13
/**
14
 * Module: cardealer
15
 *
16
 * @category        Module
17
 * @package         cardealer
18
 * @author          XOOPS Development Team <[email protected]> - <https://xoops.org>
19
 * @copyright       {@link https://xoops.org/ XOOPS Project}
20
 * @license         GPL 2.0 or later
21
 * @link            https://xoops.org/
22
 * @since           1.0.0
23
 */
24
25
use XoopsModules\Cardealer;
26
use XoopsModules\Cardealer\Form;
27
28
29
/**
30
 * Class Servpart
31
 */
32
class Servpart extends \XoopsObject
33
{
34
    /**
35
     * Constructor
36
     *
37
     * @param null
38
     */
39
    public function __construct()
40
    {
41
        parent::__construct();
42
        $this->initVar('id', XOBJ_DTYPE_INT);
43
        $this->initVar('partnum', XOBJ_DTYPE_INT);
44
        $this->initVar('itemnum', XOBJ_DTYPE_INT);
45
        $this->initVar('quantity', XOBJ_DTYPE_INT);
46
    }
47
48
    /**
49
     * Get form
50
     *
51
     * @param null
52
     * @return Cardealer\Form\ServpartForm
53
     */
54
    public function getForm()
55
    {
56
        $form = new Form\ServpartForm($this);
57
        return $form;
58
    }
59
60
    /**
61
     * @return array|null
62
     */
63
    public function getGroupsRead()
64
    {
65
        $permHelper = new \Xmf\Module\Helper\Permission();
66
67
        return $permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('id'));
68
    }
69
70
    /**
71
     * @return array|null
72
     */
73
    public function getGroupsSubmit()
74
    {
75
        $permHelper = new \Xmf\Module\Helper\Permission();
76
        return $permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('id'));
77
    }
78
79
    /**
80
     * @return array|null
81
     */
82
    public function getGroupsModeration()
83
    {
84
        $permHelper = new \Xmf\Module\Helper\Permission();
85
        return $permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('id'));
86
    }
87
}
88
89