Passed
Push — master ( 6af1fb...f5fe55 )
by Michael
02:53 queued 10s
created

Itemvotes   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 15
c 1
b 0
f 0
dl 0
loc 60
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getGroupsRead() 0 4 1
A __construct() 0 13 1
A getForm() 0 4 1
A getGroupsModeration() 0 4 1
A getGroupsSubmit() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace XoopsModules\Adslight;
6
7
/*
8
 You may not change or alter any portion of this comment or credits
9
 of supporting developers from this source code or any supporting source code
10
 which is considered copyrighted (c) material of the original comment or credit authors.
11
 
12
 This program is distributed in the hope that it will be useful,
13
 but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
*/
16
/**
17
 * Module: Adslight
18
 *
19
 * @category        Module
20
 * @author          XOOPS Development Team <https://xoops.org>
21
 * @copyright       {@link https://xoops.org/ XOOPS Project}
22
 * @license         GPL 2.0 or later
23
 */
24
25
use XoopsModules\Adslight;
26
use XoopsModules\Adslight\Form;
27
28
//$permHelper = new \Xmf\Module\Helper\Permission();
29
30
31
/**
32
 * Class Itemvotes
33
 */
34
class Itemvotes extends \XoopsObject
35
{
36
    public $helper, $permHelper;
37
    /**
38
     * Constructor
39
     *
40
     * @param null
41
     */
42
    public function __construct()
43
    {
44
        parent::__construct();
45
//        /** @var  Adslight\Helper $helper */
46
//        $this->helper = Adslight\Helper::getInstance();
47
         $this->permHelper = new \Xmf\Module\Helper\Permission();
48
49
        $this->initVar('ratingid', XOBJ_DTYPE_INT);
50
        $this->initVar('lid', XOBJ_DTYPE_INT);
51
        $this->initVar('ratinguser', XOBJ_DTYPE_INT);
52
        $this->initVar('rating', XOBJ_DTYPE_INT);
53
        $this->initVar('ratinghostname', XOBJ_DTYPE_TXTBOX);
54
        $this->initVar('ratingtimestamp', XOBJ_DTYPE_INT);
55
     }
56
57
    /**
58
     * Get form
59
     *
60
     * @param null
61
     * @return Adslight\Form\ItemvotesForm
62
     */
63
    public function getForm()
64
    {
65
        $form = new Form\ItemvotesForm($this);
66
        return $form;
67
    }
68
69
        /**
70
     * @return array|null
71
     */
72
    public function getGroupsRead()
73
    {
74
        //$permHelper = new \Xmf\Module\Helper\Permission();
75
        return $this->permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('ratingid'));
76
    }
77
78
    /**
79
     * @return array|null
80
     */
81
    public function getGroupsSubmit()
82
    {
83
          //$permHelper = new \Xmf\Module\Helper\Permission();
84
          return $this->permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('ratingid'));
85
    }
86
87
    /**
88
     * @return array|null
89
     */
90
    public function getGroupsModeration()
91
    {
92
        //$permHelper = new \Xmf\Module\Helper\Permission();
93
        return $this->permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('ratingid'));
94
    }
95
}
96
97