Workserv   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 52
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getForm() 0 4 1
A getGroupsModeration() 0 4 1
A getGroupsRead() 0 4 1
A getGroupsSubmit() 0 4 1
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
 * Class Workserv
30
 */
31
class Workserv extends \XoopsObject
32
{
33
    /**
34
     * Constructor
35
     *
36
     * @param null
37
     */
38
    public function __construct()
39
    {
40
        parent::__construct();
41
        $this->initVar('id', XOBJ_DTYPE_INT);
42
        $this->initVar('ordernum', XOBJ_DTYPE_INT);
43
        $this->initVar('itemnum', XOBJ_DTYPE_INT);
44
    }
45
46
    /**
47
     * Get form
48
     *
49
     * @param null
50
     * @return Cardealer\Form\WorkservForm
51
     */
52
    public function getForm()
53
    {
54
        $form = new Form\WorkservForm($this);
55
        return $form;
56
    }
57
58
    /**
59
     * @return array|null
60
     */
61
    public function getGroupsRead()
62
    {
63
        $permHelper = new \Xmf\Module\Helper\Permission();
64
        return $permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('id'));
65
    }
66
67
    /**
68
     * @return array|null
69
     */
70
    public function getGroupsSubmit()
71
    {
72
        $permHelper = new \Xmf\Module\Helper\Permission();
73
        return $permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('id'));
74
    }
75
76
    /**
77
     * @return array|null
78
     */
79
    public function getGroupsModeration()
80
    {
81
        $permHelper = new \Xmf\Module\Helper\Permission();
82
        return $permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('id'));
83
    }
84
}
85
86