Service   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 54
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

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