Part   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 55
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

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